Define some
m_Chart. AddSeries (0);
M_Chart. AddSeries (0);
Drawing function part of the
void CTeeChart1Dlg: : DrawLine (double * pX, double * pY, double * pZ, long nNum)
{
COleSafeArray XValues;
COleSafeArray YValues, ZValues;
Long I (0);
DWORD wLength=nNum;
XValues. Create (VT_R8, 1, & amp; WLength);
YValues. Create (VT_R8, 1, & amp; WLength);
ZValues. Create (VT_R8, 1, & amp; WLength);
CSeries Chart=(CSeries) m_Chart. Series (0);
CSeries chart=(CSeries) m_Chart. Series (0);
Chart. Put_VerticalAxis (0);
Chart. Put_VerticalAxis (0);
Chart. Put_HorizontalAxis (1);
Chart. Put_HorizontalAxis (1);
Chart. Get_XValues ();
Chart. Get_XValues ();
//Chart. The Clear ();
//chart. The Clear ();
for(i=0; I{
XValues. PutElement (& amp; I, p + I);
YValues. PutElement (& amp; I, p y + I);
ZValues. PutElement (& amp; I, p y + I);
//Chart. AddXY (pY pX [I], [I], NULL, RGB (0255255));
//chart. AddXY (pY pX [I], [I], NULL, RGB (0, 255));
}
Chart. Put_Color (RGB (0255255));
Chart. Put_Name (_T (" AAAA "));
Chart. Put_Title (_T (" AAA "));
Chart. Put_Color (RGB (0, 255));
//Chart. The Clear ();
//chart. The Clear ();
Chart. AddArray (nNum, YValues, XValues);
Chart. AddArray (nNum ZValues, XValues);
But every time the data is only a curve, where do I write wrong? Online, etc,,,
CodePudding user response:
Very important ah, look at the online tutorial or something change it for a few days, or notCodePudding user response:
CSeries chart=(CSeries) m_Chart. Series (0); To CSeries chart=(CSeries) m_Chart. Series (1);void CTeeChart1Dlg: : DrawLine (double * pX, double * pY, double * pZ, long nNum)
{
COleSafeArray XValues;
COleSafeArray YValues, ZValues;
Long I (0);
DWORD wLength=nNum;
XValues. Create (VT_R8, 1, & amp; WLength);
YValues. Create (VT_R8, 1, & amp; WLength);
ZValues. Create (VT_R8, 1, & amp; WLength);
CSeries Chart=(CSeries) m_Chart. Series (0);
CSeries chart=(CSeries) m_Chart. Series (1);//here is the calibration curve of teechart index, both of you is zero, of course not shows, to display the index of the second curve into 1 line
Chart. Put_VerticalAxis (0);
Chart. Put_VerticalAxis (0);
Chart. Put_HorizontalAxis (1);
Chart. Put_HorizontalAxis (1);
Chart. Get_XValues ();
Chart. Get_XValues ();
//Chart. The Clear ();
//chart. The Clear ();
for(i=0; I{
XValues. PutElement (& amp; I, p + I);
YValues. PutElement (& amp; I, p y + I);
ZValues. PutElement (& amp; I, p y + I);
//Chart. AddXY (pY pX [I], [I], NULL, RGB (0255255));
//chart. AddXY (pY pX [I], [I], NULL, RGB (0, 255));
}
Chart. Put_Color (RGB (0255255));
Chart. Put_Name (_T (" AAAA "));
Chart. Put_Title (_T (" AAA "));
Chart. Put_Color (RGB (0, 255));
//Chart. The Clear ();
//chart. The Clear ();
Chart. AddArray (nNum, YValues, XValues);
Chart. AddArray (nNum ZValues, XValues);