Hello!
I'm using Delphi 4 and TeeChart Pro 7.04
I have a problem with saving the Chart.Legend.Visible property to the chart.
I'm doing the following:
1) Creating my chart at runtime, the legend is hidden for default
2) Then I save the chart to a file with the editor (export), for example xy.tee (with invisible legend)
3) After saving, I set Chart.Legend.Visible = TRUE, the legend in the chart appears.
4) Now I load the chart from the file xy.tee (with invisible legend), but the legend still appears.
Is the property stored in the file, or not? What I'm doing wrong?
THX
Saving/Loading-Chart - Legend.Visible Problem
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello ghisa,
It works fine here using the code below. Could you please check if this work for you? Please feel free to modify it or send an example we can "as-is" to reproduce the problem here.
You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
It works fine here using the code below. Could you please check if this work for you? Please feel free to modify it or send an example we can "as-is" to reproduce the problem here.
You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
tmpSeries:TLineSeries;
begin
tmpChart:=TChart.Create(self);
tmpChart.Parent:=self;
tmpSeries:=TLineSeries.Create(self);
With tmpSeries do
begin
ParentChart:=tmpChart;
Randomize;
FillSampleValues();
end;
tmpChart.Legend.Visible:=false;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
tmpChart.Legend.Visible := not tmpChart.Legend.Visible;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
SaveChartToFile(tmpChart, 'mychart.tee');
tmpChart.Legend.Visible:=true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
LoadChartfromFile(TCustomChart(tmpChart), 'mychart.tee');
end;
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 |
Hello narcis!
I've tried your example. There's the same problem, it works only in one way.
If the chart.legend is hidden and I save the chart to a file (without legend, I have controlled it with TeeChartOffice) and load it into the chart on the form with visible legend, the legend disapperas. Thats ok.
But in the other way, it doesn't work. I save the chart with legend (VISIBLE) and load it into the chart on the form without legend, the legend doesn't appear.
When I take a look into the file with TeeChartOffice, the legend is saved in the chart.
Please also try this way (saving with legend), and tell me if this works for you.
I think this is a bug in the TChart.
THX
I've tried your example. There's the same problem, it works only in one way.
If the chart.legend is hidden and I save the chart to a file (without legend, I have controlled it with TeeChartOffice) and load it into the chart on the form with visible legend, the legend disapperas. Thats ok.
But in the other way, it doesn't work. I save the chart with legend (VISIBLE) and load it into the chart on the form without legend, the legend doesn't appear.
When I take a look into the file with TeeChartOffice, the legend is saved in the chart.
Please also try this way (saving with legend), and tell me if this works for you.
I think this is a bug in the TChart.
THX
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ghisa,
Yes, it works for me in both ways. If I export the chart with the legend it is imported if is not exported then it's not imported.
I've already attached the application I used and works for me at the attachments newsgroup.
Yes, it works for me in both ways. If I export the chart with the legend it is imported if is not exported then it's not imported.
I've already attached the application I used and works for me at the attachments newsgroup.
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 narcis!
I've downloaded your application and compiled it.
I do the following:
1) Run the application
2) Click on "Legend Visible"-Checkbox (now it is checked, legend visible)
3) Click on Button1
4) Click on "Legend Visible"-Checkbox (now it is not checked, legend unvisible)
5) Click on Button2
Now the legend should appear, but it doesn't.
In the mychart.tee-file there is the legend.
I'm desperated.
Do you know a way out?
THX a lot!
With best regards
I've downloaded your application and compiled it.
I do the following:
1) Run the application
2) Click on "Legend Visible"-Checkbox (now it is checked, legend visible)
3) Click on Button1
4) Click on "Legend Visible"-Checkbox (now it is not checked, legend unvisible)
5) Click on Button2
Now the legend should appear, but it doesn't.
In the mychart.tee-file there is the legend.
I'm desperated.
Do you know a way out?
THX a lot!
With best regards
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ghisa,
I've been able to reproduce the problem following your steps. I've modified slightly the import code so that it works now:
I'm going to post the updated version at attachments newsgroups. BTW: Sorry for not having set a self explainatory text at the buttons .
I've been able to reproduce the problem following your steps. I've modified slightly the import code so that it works now:
Code: Select all
procedure TForm1.Button2Click(Sender: TObject);
var
tmpChart2: TCustomChart;
begin
tmpChart.Free; //assuming Chart1 is already on the Form
tmpChart2:=TChart.Create(Self);
LoadChartfromFile(tmpChart2, 'mychart.tee');
tmpChart := tmpChart2 as TChart;
tmpChart.Parent:=Self;
end;
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 Ghisa,
You're welcome. I'm glad to hear now it works for you.
Thanks, have a nice day and weekend!
You're welcome. I'm glad to hear now it works for you.
Thanks, have a nice day and weekend!
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 |