Page 1 of 1

Drawing ellipses on TMapSeries

Posted: Thu Sep 02, 2010 9:58 am
by 15655539
Hello there,

I would like to draw some ellipses on a TMapSeries. The user should be able to zoom the map as usual and they should stick to the map and zoom as expected.
Do I need to do this using some sort of ownerdraw functionality, or is there a series i can make use of?
I would also like to draw a small arrow on the map, which should not change size with zoom.

Lastly I would eventually like to do this in the .NET version of TeeChart also.

Could somebody point me in the right direction of what i should be doto accomplish this.
Any help much appreciated!

James

Re: Drawing ellipses on TMapSeries

Posted: Fri Sep 03, 2010 2:32 pm
by yeray
Hi James,

In VCL you could do something as follows. I'm not sure if that's the behaviour you would like to have. If you want your arrow not to zoom at all you should draw it manually at OnAfterDraw event.

Code: Select all

uses TeeWorldSeries, TeeShape, ArrowCha;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  with Chart1.AddSeries(TWorldSeries) do
    FillSampleValues();

  with Chart1.AddSeries(TChartShape) as TChartShape do
  begin
    Gradient.Visible:=true;
    X0:=-20;
    X1:=0;
    Y0:=-40;
    Y1:=0;
    Transparency:=20;
  end;

  with Chart1.AddSeries(TArrowSeries) as TArrowSeries do
  begin
    AddArrow(-40, 50, -20, 0);
    ArrowWidth:=10;
    ArrowHeight:=20;
    Pointer.Pen.Width:=2;
  end;
end;
In .NET it should be too different. If you find troubles with it, don't hesitate to let us know.