Add function to Tee-chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
OptiSurface
Newbie
Newbie
Posts: 5
Joined: Fri Feb 08, 2013 12:00 am

Add function to Tee-chart

Post by OptiSurface » 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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Add function to Tee-chart

Post by Narcís » Mon Jul 15, 2013 3:39 pm

Hello,

There's a VC++ example at tutorial 15, at the bottom of the Coding TeeChart for runtime section. Tutorails can be found at TeeChart's program group. Can you please check if that works at your end?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OptiSurface
Newbie
Newbie
Posts: 5
Joined: Fri Feb 08, 2013 12:00 am

Re: Add function to Tee-chart

Post by OptiSurface » Thu Jul 18, 2013 10:32 am

Thanks for your reply.

In TeeChart2011.chm tutorial 15 is regarding XML Export & Import.
Tutorial 7 is Working with Functions, but sample code given in tutorial is in VB.

I need to set same data source of existing series to the newly added series.

I could not find the VC++ example Coding TeeChart for run time section.
Please let me know where should i look for the C++ example for adding a function.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Add function to Tee-chart

Post by Narcís » Thu Jul 18, 2013 10:37 am

Hello,

Are you using TeeChart ActiveX? The tutorial file you mention corresponds to TeeChart for .NET.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OptiSurface
Newbie
Newbie
Posts: 5
Joined: Fri Feb 08, 2013 12:00 am

Re: Add function to Tee-chart

Post by OptiSurface » Fri Jul 19, 2013 4:28 am

Thanks for the reply.
Yes, i am using TeeChart ActiveX. I found the correct tutorial file.
Using VC++ equivalent code provided in tutorial 15 i am able to set same data source of existing series to the newly added series.

Post Reply