Graph Export - Multi Series only want first X range

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MSS
Newbie
Newbie
Posts: 3
Joined: Fri Feb 04, 2011 12:00 am

Graph Export - Multi Series only want first X range

Post by MSS » Thu Feb 10, 2011 4:49 pm

I am exporting a full range of Series from a chart. My X range in each series is a date field in an ADOQuery.

TSeriesDataXLS *XLSExp= new TSeriesDataXLS(AttendChart, NULL);


I do not want to have the resultant XLS file have....

Date1 Data1 Date2 Data2 Date3 Data3


Question: is there a way to only export the X range for the first series and then the y range data for subsequent series into the single workbook.
e.g.
Date1 Data1 Data2 Data3 Date4

Regards
Shaun

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Graph Export - Multi Series only want first X range

Post by Sandra » Fri Feb 11, 2011 1:03 pm

Hello MSS,

I don't reproduce your problem here using next code:

Code: Select all

uses Series, TeExport, TeeStore;
procedure TForm1.FormCreate(Sender: TObject);
var Series1,Series2,Series3:TLineSeries;
begin
    Series1 := TLineSeries.Create(self);
    Series2 := TLineSeries.Create(self);
    Series3 := TLineSeries.Create(self);
    Chart1.AddSeries(Series1);
    Chart1.AddSeries(Series2);
    Chart1.AddSeries(Series3);
    Chart1.SeriesList.FillSampleValues(10);
    with TSeriesDataXLS.Create(Chart1,nil) do
    begin
      IncludeIndex:=True;
      IncludeLabels:=True;
      IncludeHeader:=True;
     SaveToFile('c:\Chart1.xls');
     end;
end;
Could you please check if previous code reproduces your problem? If it doesn't reproduce your problem please send us a simple project so we can reproduce your problem here, so we can try to help you.

Thanks,
Best Regards,
Sandra Pazos / 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

MSS
Newbie
Newbie
Posts: 3
Joined: Fri Feb 04, 2011 12:00 am

Re: Graph Export - Multi Series only want first X range

Post by MSS » Mon Feb 14, 2011 11:23 am

Im not using random data,
Each series is date range based.

That is each series shares the same date.

e.g 1 oct to 1 dec.
The Y values for each series are taken from various fields in the TQuery, The x value is the date for all series.

MSS
Newbie
Newbie
Posts: 3
Joined: Fri Feb 04, 2011 12:00 am

Re: Graph Export - Multi Series only want first X range

Post by MSS » Mon Feb 14, 2011 1:48 pm

Sandra,

If you use an x range label for example to display the date in series 1.

When you export you always get a blank column headed with the word text. It seems to expect labels for each subsequent series. I don't want them.

You example only outputs Y values so only has to export Y values, I need to export some date ranges and indeed some other text using the labels and X range values. However when you do this for the first series the other series seem to expect a value and so place blank columns in the spreadsheet - headed "TEXT" which I don't want as it will confuse my users.

If I need to change the chart type or selected stacked or something to prevent this, please let me know.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Graph Export - Multi Series only want first X range

Post by Sandra » Mon Feb 21, 2011 3:33 pm

Hello MSS,

I have added you request in wish-list with number [TV52015404] to be considered inclusion in next maintenance releases of TeeChartVCL. On the other hand, for now, one solution would be converted X values as Labels, as do in next example code:

Code: Select all

uses Series, TeExport, TeeStore;
procedure TForm1.FormCreate(Sender: TObject);
var Series1,Series2,Series3:TLineSeries;
i:Integer;
text: String;
begin
    Series1 := TLineSeries.Create(self);
    Series2 := TLineSeries.Create(self);
    Series3 := TLineSeries.Create(self);
    Chart1.AddSeries(Series1);
    Chart1.AddSeries(Series2);
    Chart1.AddSeries(Series3);
    Chart1.SeriesList.FillSampleValues(10);
    with TSeriesDataXLS.Create(Chart1,nil) do
    begin
      IncludeIndex :=True;
      IncludeLabels:=True;
      IncludeHeader:=True;
    For i:=0 to Series1.Count do
    begin
        Series1.Labels[i] :=FloatToStr(Series1.XValues[i])
    end;
     SaveToFile('Chart1.xls');
    end;
end;
Thanks,
Best Regards,
Sandra Pazos / 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

Post Reply