First: D7, XP, TeeChart Pro 7.07.
I use a Tchart to display Measurement Data (each Minute) from different sources using LineSeries.
All series using just one X-Axis displaying data over the time from times between 0:00 to 24:00.
I want to Export this Data to one Excel File.
I've done it using the:
TSeriesDataXLS.Create(Chart1,nil)...
method.
Now the problems:
1. Is it possible only to export the active series or some selected series?
I just found solutions for one or all series. But If I use all - it exports
also the inactive series...
2. the exported file contains allway pairs of X and Y. (X,Y,X,Y,...)
Is it possibe to export only one X (timebase) like X, y1, y2, y3...
3. I managed to export the legends Title using that example - but how do I do it for ONE x-Axis (if possible)?
4. How can I export the X-Axis Data as DateTime and not as real?
Thanks in advance
Jogi
TChart Export to Excel
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jogi,
Please find below the answers to your questions:
Please find below the answers to your questions:
You can create a dummy chart without inactive series like this:1. Is it possible only to export the active series or some selected series?
I just found solutions for one or all series. But If I use all - it exports
also the inactive series...
Code: Select all
Uses TeeStore, TeExport;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
begin
Chart1[i].FillSampleValues();
if i mod 2 <> 0 then Chart1[i].Active:=false;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var tmpChart: TChart;
i: Integer;
begin
//Create dummy chart without inactive series
tmpChart := TChart.Create(Self);
for i:=Chart1.SeriesCount-1 downto 0 do
if Chart1[i].Active then
CloneChartSeries(Chart1.Series[i]).ParentChart := tmpChart;
{ nil = all series in Chart1 }
with TSeriesDataXLS.Create(tmpChart,nil) do
try
IncludeIndex:=true;
IncludeHeader:=true;
SaveToFile('c:\temp\exceltest.xls');
ShowSavedFile;
finally
Free;
end;
tmpChart.Free;
end;
procedure TForm1.ShowSavedFile;
begin
TeeGotoURL(Handle,'c:\temp\exceltest.xls');
end;
Using code example above already does it.2. the exported file contains allway pairs of X and Y. (X,Y,X,Y,...)
Is it possibe to export only one X (timebase) like X, y1, y2, y3...
You can do something like the example below. I'm afraid it's not possible to only include one single XValues column:3. I managed to export the legends Title using that example - but how do I do it for ONE x-Axis (if possible)?
Code: Select all
Uses TeeConst, TeeStore, TeExport;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
begin
Chart1[i].XValues.DateTime:=true;
Chart1[i].FillSampleValues();
if i mod 2 <> 0 then Chart1[i].Active:=false;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var tmpChart: TChart;
i: Integer;
begin
//Create dummy chart without inactive series
tmpChart := TChart.Create(Self);
for i:=Chart1.SeriesCount-1 downto 0 do
if Chart1[i].Active then
begin
CloneChartSeries(Chart1[i]).ParentChart := tmpChart;
tmpChart[tmpChart.SeriesCount-1].XValues.Name:='MyXValues';
tmpChart[tmpChart.SeriesCount-1].YValues.Name:='MyYValues';
TeeMsg_Text := 'CustomTextName';
end;
{ nil = all series in Chart1 }
with TSeriesDataXLS.Create(tmpChart,nil) do
try
IncludeIndex:=true;
IncludeHeader:=true;
IncludeLabels:=true;
SaveToFile('c:\temp\exceltest.xls');
ShowSavedFile;
finally
Free;
end;
tmpChart.Free;
end;
procedure TForm1.ShowSavedFile;
begin
TeeGotoURL(Handle,'c:\temp\exceltest.xls');
end;
You have to do that in Excel and set the columns format you wish to DateTime.4. How can I export the X-Axis Data as DateTime and not as real?
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcís,
thanks for the quick reply - the steema support is always fast and good - a pleasure!
But - one problem ist still there:
I figured out, that if I add the:
Chart1.XValues.DateTime:=true;
in the "OnCreate Event" it also happens in the clean program.
So setting the DateTime Property prevents the program to export just a single X-axis.
Any solutions?
Thanks
Jogi
thanks for the quick reply - the steema support is always fast and good - a pleasure!
But - one problem ist still there:
If I do a clean project your code (for topic 2) works, but in my program I always get: X,Y,X,Y,...narcis wrote:[...]
Using code example above already does it.2. the exported file contains allway pairs of X and Y. (X,Y,X,Y,...)
Is it possibe to export only one X (timebase) like X, y1, y2, y3...
[...]
I figured out, that if I add the:
Chart1.XValues.DateTime:=true;
in the "OnCreate Event" it also happens in the clean program.
So setting the DateTime Property prevents the program to export just a single X-axis.
Any solutions?
Thanks
Jogi
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jogi,
I'm afraid not. Seems XValues are automatically included when they are not automatically sequential generated values (eg.: 0,1,2,3,...). I'll add your request to our wish-list to be considered for inclusion in future releases.
I'm afraid not. Seems XValues are automatically included when they are not automatically sequential generated values (eg.: 0,1,2,3,...). 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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jogi,
No, there are no plans to implement new features in TeeChart v7. They would be included in v8 or future versions.
TeeChart VCL optionally is also sold with full sourcecode so that clients can customize it to fit their needs.
No, there are no plans to implement new features in TeeChart v7. They would be included in v8 or future versions.
TeeChart VCL optionally is also sold with full sourcecode so that clients can customize it to fit their needs.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |