what's wrong here?
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I'm trying to plot a non linear graph using MSChart. I set up the array and val stores the result of the calculation. However, the graph I plot appears linear and it's plotted val vs val whereas I want index[0] vs val?
double val=0; double step=0.5; DWORD numElements[] = {10, 2} saRet.Create(VT_VARIANT, 2, numElements); long index[2]; for(index[0]=0; index[0]<10; index[0]++) { for(index[1]=0; index[1]<2; index[1]++) { val = index[0]*index[0]; saRet.PutElement(index, COleVariant( val )); val += step; } } m_chart.SetChartData(saRet.Detach()); m_chart.Refresh(); }
Any ideas? Cheers