Add function to Tee-chart
Posted: Fri Jul 12, 2013 12:18 pm
My application is developed in C++ using MFC.
I have two series added in the Tee-chart.
Series are filled with the arrays.
Code to add array to series:
m_Chart1.Series(seriesIndex).AddArray(safeArrayLength,YValues,XValues);
Now, I want to add a function called 'Curve Fitting'
Steps followed:
1. Create new series
long seriesIndex = m_Chart1.AddSeries(scLine);
2. Set function for series
m_Chart1.Series(seriesIndex).SetFunction(tfCurveFit);
3. Set datasource for series
m_Chart1.Series(0).CheckDataSource();
m_Chart1.Series(seriesIndex).SetDataSource(m_Chart1.Series(0).GetDataSource());
Result:
Using the code mentioned above in steps:
1. New series is added to Tee-chart
2. Function is set to newly added series.
3. But data source is not set for the function.
I get Bad pointer returned from m_Chart1.Series(0).GetDataSource().
My problem is i didn't get the valid data-source from series 0.
Please suggest me how should i set data source to series and also suggest how should i add the function to Tee-chart.
I have two series added in the Tee-chart.
Series are filled with the arrays.
Code to add array to series:
m_Chart1.Series(seriesIndex).AddArray(safeArrayLength,YValues,XValues);
Now, I want to add a function called 'Curve Fitting'
Steps followed:
1. Create new series
long seriesIndex = m_Chart1.AddSeries(scLine);
2. Set function for series
m_Chart1.Series(seriesIndex).SetFunction(tfCurveFit);
3. Set datasource for series
m_Chart1.Series(0).CheckDataSource();
m_Chart1.Series(seriesIndex).SetDataSource(m_Chart1.Series(0).GetDataSource());
Result:
Using the code mentioned above in steps:
1. New series is added to Tee-chart
2. Function is set to newly added series.
3. But data source is not set for the function.
I get Bad pointer returned from m_Chart1.Series(0).GetDataSource().
My problem is i didn't get the valid data-source from series 0.
Please suggest me how should i set data source to series and also suggest how should i add the function to Tee-chart.