Hello,
I am trying to draw polygons in a TChart and encountered some issues with the MapSeries.
First, I do not quite understand how to draw polygons at all. The functions seem to have changed recently, because browsing the forums did not yield any results for me. The included HTML help file was not useful to me either.
I would appreciate it if you could show me a sample source code where you create a map series and draw some simple shape, a triangle perhaps.
The second issue i found is, that when creating a map series with the editor, trying to access the Shapes Tab in the parent tab "Format" causes access violations - as many as there are polygons, I think.
I am using TeeChart Pro v2013.08.130521 32bit VCL in Delphi XE4.
I hope you can help me on that matter.
If no quick solution for the issue can be found, it would be nice if you could show me an alternative to polygon drawing.
Best regards
MapSeries issues
MapSeries issues
- Attachments
-
- screenshot with AV
- 06-09-2013 14-02-29.png (69.99 KiB) Viewed 6444 times
Re: MapSeries issues
Hi,
I've just added an TChartEditor to the example above:
Here it is a simple example of how to create the TChart, the TMapSeries, and how to add a triangle (shape) to it:BHinnoForce wrote:First, I do not quite understand how to draw polygons at all. The functions seem to have changed recently, because browsing the forums did not yield any results for me. The included HTML help file was not useful to me either.
I would appreciate it if you could show me a sample source code where you create a map series and draw some simple shape, a triangle perhaps.
Code: Select all
uses Chart, TeeMapSeries;
var Chart1: TChart;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Align:=alClient;
Chart1.View3D:=false;
with Chart1.AddSeries(TMapSeries) as TMapSeries do
begin
with Shapes.Add do
begin
AddXY(0,0);
AddXY(3,3);
AddXY(2,5);
end;
end;
end;
I get a similar error with the same code above and the last TeeChart v2013.08, but not with the actual sources that would be used for the next maintenance release.BHinnoForce wrote:The second issue i found is, that when creating a map series with the editor, trying to access the Shapes Tab in the parent tab "Format" causes access violations - as many as there are polygons, I think.
I've just added an TChartEditor to the example above:
Code: Select all
private
{ Private declarations }
procedure Chart1DblClick(Sender: TObject);
//...
uses {...}, TeeEdit, TeeMapSeriesEdit;
//...
procedure TForm1.FormCreate(Sender: TObject);
begin
{...}
Chart1.OnDblClick:=Chart1DblClick;
end;
procedure TForm1.Chart1DblClick(Sender: TObject);
begin
with TChartEditor.Create(Self) do
begin
Chart:=Chart1;
Execute;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: MapSeries issues
Thank you very much for the quick reply.
Instead of adding more points to one polygon, I created several polygons consisting of only one point - at least I think that is what happens.
instead of
Best regards
Instead of adding more points to one polygon, I created several polygons consisting of only one point - at least I think that is what happens.
Code: Select all
for I := 0 to Length(CoordContainer.X) - 1 do
with Shapes.Add do
begin
AddXY(CoordContainer.X[I], CoordContainer.Y[I]);
end;
Code: Select all
with Shapes.Add do
begin
for I := 0 to Length(CoordContainer.X) - 1 do
AddXY(CoordContainer.X[I], CoordContainer.Y[I]);
end;
Re: MapSeries issues
Hi,
Right, it seems to be the difference between those code snippets.
Don't hesitate to let us know if you still find problems with it.
Right, it seems to be the difference between those code snippets.
Don't hesitate to let us know if you still find problems with it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |