How to export selected series only

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

How to export selected series only

Post by David » Mon Jun 19, 2006 8:54 am

Hi,

There are many series in one chart and when exporting to xls or text file, I only need part of them. How can I define which sereis are to be exported?

Thank you.
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 » Mon Jun 19, 2006 9:17 am

Hi David,

You can use something like this:

Code: Select all

    TChart1.Export.asXLS.Series = 0
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 » Mon Jun 19, 2006 9:26 am

Hi, Narcís,

Still the old problem. How to do it in VC++? Would you please provide the C++ code? Thank you very much!

BTW, would you please help me with this question I asked?
http://www.teechart.net/support/viewtopic.php?t=4154

David

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

Post by David » Mon Jun 19, 2006 9:39 am

Hi, Narcís,

I figured out how to do it in VC++, but it seems this method can only export one sereis. What if I want to export 2 or more series among 10 series?

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 » Mon Jun 19, 2006 10:33 am

Hi David,

You can only do this exporting each series in a different file, repeating the process for each series. Otherwise you can only export one or all series in a chart.

BTW: I'll add your request to our wish-list to be considered for inclusion in future releases.
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 » Mon Jun 19, 2006 10:44 am

Thanks!

MattG
Newbie
Newbie
Posts: 23
Joined: Thu Jun 27, 2013 12:00 am

Re: How to export selected series only

Post by MattG » Mon Oct 14, 2013 10:53 pm

Did this feature ever make it into TChart, i.e., can we export a series subset as a text file?

Thanks,
Matt Garrett
CRTech
Boulder, Colorado, USA

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to export selected series only

Post by Yeray » Tue Oct 15, 2013 11:56 am

Hi,

I'm afraid not. However I think you could implement a method to do that. This method could clone the chart to a hidden chart; it could remove the unwanted series from this hidden chart and export that chart. Something like this:

Code: Select all

Private Sub Form_Load()
  TChart1.Aspect.View3D = False

  Dim i As Integer
  For i = 0 To 2
    TChart1.AddSeries scBar
    TChart1.Series(i).FillSampleValues
  Next i
  
  tmpChart.Visible = False
End Sub

Private Sub ExportXMLSeries(ByRef ser() As Integer)
  tmpChart.Import.LoadFromStream TChart1.Export.asNative.SaveToStream(True)
  
  Dim i, j As Integer
  Dim found As Boolean
  For i = tmpChart.SeriesCount - 1 To 0 Step -1
    found = False
    For j = 0 To UBound(ser) - 1
      If i = ser(j) Then
        found = True
      End If
    Next j
    If Not found Then
      tmpChart.RemoveSeries i
    End If
  Next i
  
  tmpChart.Export.asXML.SaveToFile "C:\tmp\MyXMLChart.xml"
End Sub

Private Sub Command1_Click()
  Dim seriesSet(2) As Integer
  seriesSet(0) = 0
  seriesSet(1) = 2
  
  ExportXMLSeries seriesSet
End Sub
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

MattG
Newbie
Newbie
Posts: 23
Joined: Thu Jun 27, 2013 12:00 am

Re: How to export selected series only

Post by MattG » Mon Oct 28, 2013 10:33 pm

Thanks Yeray. That worked. I cloned the chart and removed the unwanted series from the clone, then exported. I was actually using .NET; the existing forum thread happened to be in ActiveX.
Matt Garrett
CRTech
Boulder, Colorado, USA

Post Reply