Export chart who contain multiple series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Glenn F. Henriksen
Newbie
Newbie
Posts: 52
Joined: Tue Mar 04, 2003 5:00 am

Export chart who contain multiple series

Post by Glenn F. Henriksen » Thu Feb 03, 2005 11:28 am

I have a chart with 2 Series.
The X axes represent the time.
The Y axes represent double values.

An export of the chart give a result like that:
"Y value of serie 1" "X value of serie 1" "Y value of serie 2" "X value of serie 2"

The values are correct, but I wil not see the 2 time the X values because they are equal ("X value of serie 1" = "X value of serie 2")

A second question is how can I have the header of the series when I export to an excel file. Actually I receive only the letter "Y" for each column !
My code is :
....Export.Data.Excel.IncludeHeader = True
....Export.Data.Excel.IncludeIndex = True
....Export.Data.Excel.IncludeLabels = True
....Export.Data.Excel.Save("C:\Temp\Test.xls")

Thanks

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Fri Feb 04, 2005 9:09 am

Hi, Lancer.
"Y value of serie 1" "X value of serie 1" "Y value of serie 2" "X value of serie 2"
I think this is as designed. TeeChart export algorithm does not check if all series have the same x values. It merely checks if series x values are not indexed values (0,1,2,3..) and if they're not, adds x values as new column to export file.
A second question is how can I have the header
If Header is set tu true then series x,y values name (field header, not series title) will be included in export. If you want to change this (control header text for each exported column), you should change each series XValues, YValues Name variable. Example:

Code: Select all

      line1.XValues.Name = "line1_xvals";
      line1.YValues.Name = "line1_yvals";
      line2.XValues.Name = "line2_xvals";
      line2.YValues.Name = "line2_yvals";
      Steema.TeeChart.Export.ExcelFormat excel = new Steema.TeeChart.Export.ExcelFormat(tChart2.Chart);
      excel.IncludeHeader = true;
      excel.Save("d:\\temp\\test.xls");
Marjan Slatinek,
http://www.steema.com

Post Reply