About the using of SeriesXMLSource
Posted: Tue Mar 08, 2011 7:25 am
Hello,
I use the SeriesXMLSource1 to add the data to my chart ,but it happens a error . The following is my code:
codeļ¼
LPTSTR LP;
CString STR;
m_pIndex++;
//Chart1 *m_Chart2;
VARIANT SourceSeries;
//m_Chart1.AddSeries(1);
UpdateData(TRUE);
SourceSeries.vt=VT_DISPATCH;
CSeries InputSeries=m_Chart1.Series(0);
SourceSeries.pdispVal=InputSeries;
//x axis lable format set
CAxes Axes;
CAxis Axis;
Axes=m_Chart1.get_Axis();
CAxisLabels Axislabels=Axes.GetBottom().GetLabels();
Axislabels.SetDateTimeFormat(L"yy-mm-dd HH:mm:ss");
//databinding
m_SeriesXMLSource1.SetFileName(L"D:\\DEV-DEMO\\SampleData.xml"); //This can also be a local file
m_SeriesXMLSource1.SetSeries(SourceSeries);
m_SeriesXMLSource1.SetSeriesNode(L"USA");
m_SeriesXMLSource1.SetValueSource(L"Bar");
m_SeriesXMLSource1.Open();
The attachment is the screenshot of error and the xml file. Is there something wrong in my xml file (The "X" is seted to a date value )?
I use the SeriesXMLSource1 to add the data to my chart ,but it happens a error . The following is my code:
codeļ¼
LPTSTR LP;
CString STR;
m_pIndex++;
//Chart1 *m_Chart2;
VARIANT SourceSeries;
//m_Chart1.AddSeries(1);
UpdateData(TRUE);
SourceSeries.vt=VT_DISPATCH;
CSeries InputSeries=m_Chart1.Series(0);
SourceSeries.pdispVal=InputSeries;
//x axis lable format set
CAxes Axes;
CAxis Axis;
Axes=m_Chart1.get_Axis();
CAxisLabels Axislabels=Axes.GetBottom().GetLabels();
Axislabels.SetDateTimeFormat(L"yy-mm-dd HH:mm:ss");
//databinding
m_SeriesXMLSource1.SetFileName(L"D:\\DEV-DEMO\\SampleData.xml"); //This can also be a local file
m_SeriesXMLSource1.SetSeries(SourceSeries);
m_SeriesXMLSource1.SetSeriesNode(L"USA");
m_SeriesXMLSource1.SetValueSource(L"Bar");
m_SeriesXMLSource1.Open();
The attachment is the screenshot of error and the xml file. Is there something wrong in my xml file (The "X" is seted to a date value )?