Page 1 of 1

Export dialog.

Posted: Thu Nov 05, 2009 2:59 pm
by 9530487
Hello,

I have a graph showing various series. When I start the export dialog, I select the "Data" tab, click "Excel" as the format and then "Save".

The output is similar to
Index X Y X Y X Y X Y X Y X Y X Y
0 1850 0.019771321 1850 0.176737741 1850 7.9422E-05 1850 0.00043554 1850 0.00210084 1850 0.000389058 1850 0.00027816
1 1851 0.024606179 1851 0.173912227 1851 0.000111703 1851 0.00043554 1851 0.00210084 1851 0.000402893 1851 0.00027816
2 1852 0.026761919 1852 0.180478275 1852 0.000143984 1852 0.00043554 1852 0.00210084 1852 0.000416728 1852 0.00027816
3 1853 0.03012912 1853 0.186740533 1853 0.000176266 1853 0.00043554 1853 0.00210084 1853 0.000430562 1853 0.00027816

But this is fairly useless as there is no indication of what the Y series are referring to.

Is it possible to get the series titles and x-axis titles to export instead of the X and Y? I've tried all the options in the export dialog (point index, point labels, header etc).

Many thanks,

Tony.

Re: Export dialog.

Posted: Fri Nov 06, 2009 9:06 am
by yeray
Hi Tony,

The following code seems to work fine here. Doesn't it fit your needs?

Code: Select all

Private Sub Form_Load()
  TChart1.Aspect.View3D = False
  
  Dim i, j As Integer
  For i = 0 To 6
    TChart1.AddSeries scPoint
    TChart1.Series(i).XValues.Name = "Series " + Str$(i) + " X values"
    TChart1.Series(i).YValues.Name = "Series " + Str$(i) + " Y values"
    For j = 0 To 3
      TChart1.Series(i).AddXY 1850 + j, Rnd, "", clTeeColor
    Next j
  Next i
  
  With TChart1.Export.asXLS
    .IncludeHeader = True
    .SaveToFile "C:\tmp\test.xls"
  End With
End Sub

Re: Export dialog.

Posted: Fri Nov 06, 2009 9:14 am
by 9530487
I see. I had no idea you needed to give the X and Y values names as well (I just assumed it would take the series names).

Re: Export dialog.

Posted: Mon Nov 09, 2009 8:22 am
by 9530487
Just a quick question regarding this.

In a separate problem (for which I was emailing direct to Ara Villarreal), I was told the following.

"First of all please notice that TeeChart Pro ActiveX is a COM wrapper of TeeChart Pro VCL. Having said that, SetName uses object's Name property in Delphi which clearly is not designed for the purposes you are trying to do.

Please use _series.SetTitle("some title"), not _series.SetName. SetName names the Series object, names should be limited to less than 64 characters."

I know the problem above is related to series and not the XValues, but does this mean I am likely to hit problems if I call
TChart1.Series(i).XValues.Name
with long names?

Tony.