User (Legacy) Posted January 24, 2002 Report Share Posted January 24, 2002 Hi, I need to add new series in XY chart dynamically. Each series may have different numbers of data. For example, series 1 has 100 points with range from 1 to 100, series 2 has 1000 points with range from 500 to 1000. And I have to load the data of next series after all previous series were displayed. All series of data should go in the same chart. I loaded the data of series 1 using the code as follows: m_pChartFX->OpenDataEx(COD_VALUES,1,100); m_pChartFX->OpenDataEx(COD_XVALUES,1,100); m_pChartFX->Series->Item[0]->Yvalue[0] = 1; m_pChartFX->Series->Item[0]->Yvalue[1] = 45; m_pChartFX->Series->Item[0]->Yvalue[2] = 60; ..... m_pChartFX->Series->Item[0]->Xvalue[0] = 10; m_pChartFX->Series->Item[0]->Xvalue[1] = 21; m_pChartFX->Series->Item[0]->Xvalue[2] = 32; .... m_pChartFX->CloseData((CfxCod) (COD_XVALUES|COD_SMOOTH)); m_pChartFX->CloseData(COD_VALUES); It works fine. But when I tried to load the XY pair of data of series 2 in m_pChartFX->Series->Item[1], I got the abnormal program termination error. Is any propery I should set to load the unknow number of series? Or what should I do before I can load the second series of data? Thanks, Link to comment Share on other sites More sharing options...
Software FX Posted January 24, 2002 Report Share Posted January 24, 2002 Before you try accesing the second series (m_pChartFX->Series->Item[1]) you must do: m_pChartFX->OpenDataEx(COD_VALUES,2,100); m_pChartFX->OpenDataEx(COD_XVALUES,2,100); ... -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.