Hi,
I have created a TMapSeries with some polygons, in this test case a square, what I would like to do is to save the chart with the TMapSeries and its corresponding polygon to file and then load it again. What seems to occur is that the TMapSeries is there but the polygon points doesnt appear after LoadChartFromFile. See the test code below:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, TeCanvas,
Dialogs, StdCtrls, ExtCtrls, TeeProcs, TeEngine, Chart, Series, TeeStore, TeeMapSeries;
type
TForm1 = class(TForm)
Chart1: TChart;
btnCreate: TButton;
btnLoad: TButton;
procedure btnCreateClick(Sender: TObject);
procedure btnLoadClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btnCreateClick(Sender: TObject);
var
ASerie: TMapSeries;
APol: TTeePolygon;
i: integer;
begin
ASerie:=TMapSeries.Create(Chart1);
ASerie.ParentChart:=Chart1;
APol:=ASerie.Shapes.Add;
with APol.Points do
begin
AddXY(1,1);
AddXY(1,10);
AddXY(10,10);
AddXY(10,1);
end;
SaveChartToFile(Chart1,'C:\test.tee');
end;
procedure TForm1.btnLoadClick(Sender: TObject);
var tmpChart:TCustomChart;
begin
Chart1.Free; //assuming Chart1 is already on the Form
tmpChart:=TChart.Create(Self);
LoadChartfromFile(tmpChart,'c:\test.tee');
Chart1 := tmpChart as TChart;
Chart1.Parent:=Self;
end;
end.
If anyone has any idea how to make this work I would be grateful.
Best Regards,
Johan Ingemansson
Problems using Load-/SaveChartToFile with TMapSeries
-
- Newbie
- Posts: 59
- Joined: Fri May 28, 2004 4:00 am
- Location: Sweden
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Johan,
Yes, this is a problem we are aware of and is on our wish-list to be enhanced for future releases. For now you need to do it manually as in the TeeMaps demo included with TeeChart binary installers at, for example: C:\Program Files\Steema Software\TeeChart 7.08 for Delphi 2006\Examples\TeeMaps.
Yes, this is a problem we are aware of and is on our wish-list to be enhanced for future releases. For now you need to do it manually as in the TeeMaps demo included with TeeChart binary installers at, for example: C:\Program Files\Steema Software\TeeChart 7.08 for Delphi 2006\Examples\TeeMaps.
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 |