How to combine 2 series in two chart into one chart?

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

How to combine 2 series in two chart into one chart?

Post by David » Tue May 30, 2006 8:18 am

Hi, there,

If I have two charts displaying two series seperately, is there any way to combine them and display in only one chart?

Thanks!
David

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

Post by Narcís » Tue May 30, 2006 9:02 am

Hi David,

Could you please gives us some more information on how would you like to combine the series?

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

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Tue May 30, 2006 10:16 am

Hi, Narcís,

For example, chart1 contains a fastline series fs1 displaying speed(Y) vs position (x) and x is from x1 to x2, and chart2 contains another fastline series fs2 also displaying speed vs position from x3 to x4. Is it possible to use chart3 to display fs1 and fs2 together with x ranging from min(x1,x3) to max(x2,x4)?

Thanks a lot!
David

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

Post by Narcís » Tue May 30, 2006 10:26 am

Hi David,

The easiest way to achieve that may be exporting both series data to XML and then import data to chart3 use XML LoadMode set to lmAppend as here.

For more information on how to import and export charts please read Tutorial 12 - Exporting and Importing Charts. You'll find the tutorials at TeeChart's program group.
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

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Wed May 31, 2006 1:15 am

Hi, Narcís

If I export the series first, does that mean there has to be temporary files generated? And what is the difference between SeriesTextSource and SeriesXMLSource besides the file format? Also from the thread you suggested, I guessed that there is only one series in that XML file. If I have to load two xml files or even more, How should I realize it? A simple example will be greatly appreciated!

Thank you very much!

David

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

Post by Narcís » Wed May 31, 2006 9:12 am

Hi David,
If I export the series first, does that mean there has to be temporary files generated?


Yes, you should create at least one xml file.
And what is the difference between SeriesTextSource and SeriesXMLSource besides the file format?


SeriesXMLSource only loads a xml file to a chart while SeriesTextSource lets you allows access to the properties and methods associated with the manipulation of data from text sources. I.e.: You can choose which columns to plot, which is the column separator, etc.
Also from the thread you suggested, I guessed that there is only one series in that XML file. If I have to load two xml files or even more, How should I realize it? A simple example will be greatly appreciated!
No, you can have more than one series in a xml file as you can see in the All Features\Welcome!\Components\XML Import Source\XML from Web example at TeeChart features demo, available at its program group.

Regarding on how to append data when importing an xml file you can do something like this:

Code: Select all

Private Sub Command1_Click()
    TChart1.Series(0).FillSampleValues 10
End Sub

Private Sub Command2_Click()
    TChart1.Export.asXML.SaveToFile ("C:\temp\chart.xml")
End Sub

Private Sub Command3_Click()
  With SeriesXMLSource1
    .FileName = "C:\temp\chart.xml"
    .Series = TChart1.Series(0)
    .SeriesNode = "Series0"
    .LoadMode = lmAppend
    .ValueSource = "Y"
    '.Open
    .Load
  End With
End Sub

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 10
End Sub
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

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Wed May 31, 2006 9:47 am

Hi, Narcís,

Thank you very much for the reply. But still the old problem, would you please convert the VB code to VC code? I sometimes found it really difficult to do it myself because the teechart tutorial on VC app is too limited.

Thanks for your help.

David

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Jun 08, 2006 11:43 am

Hi David,

I'm not sure if you still having problem with the Translation of the XmlSource seeing your other post. If you need help translating it please let me know (and also which part of code ) and I'll do it asap.

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Fri Jun 09, 2006 1:29 am

Thank you very much, Pep. I have replied in http://www.teechart.net/support/viewtop ... 5217#15217.

I remember you also replied my previous questions on Teechart in VC++. It seems you are the only one that knows how to use Teechart in VC++.

Thanks again.
David

Post Reply