TMapSeries starting zoom level

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

TMapSeries starting zoom level

Post by bdw » Thu May 20, 2010 4:14 am

Hello,
We have TChart 7.08 and are trying to use the TMapSeries graph and have an initial zoom level. We load a world map but would like to start the display at a zoomed in area.

Is this possible to do ?

I have tried setting the LeftAxis->Minimum and Maximum values but no luck. Is there a way of waiting for all of the world shape file to be loaded and then call ZoomRect maybe ?

At present we are using the example TeeSHP.bas example to load the shape file.

Regards,
Brett.

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: TMapSeries starting zoom level

Post by bdw » Thu May 20, 2010 4:56 am

I have manged to work this out by calling zoomrect() in the OnAfterDraw() function.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TMapSeries starting zoom level

Post by Yeray » Thu May 20, 2010 2:20 pm

Hi bdw,

I'm glad to see you've managed it to work.
Maybe you needed to set your axes.automatic as false before changing its minimum and maximum values. Or even easier, you could use SetMinMax functions.

For example, the following works fine here:

Code: Select all

uses TeeMapSeries;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TMapSeries.Create(self));
  Chart1[0].FillSampleValues();

  //option 1
{  Chart1.Draw;
  Chart1.Axes.Bottom.Automatic:=false;
  Chart1.Axes.Bottom.Minimum:=10;
  Chart1.Axes.Bottom.Maximum:=15;
  Chart1.Axes.Left.Automatic:=false;
  Chart1.Axes.Left.Minimum:=10;
  Chart1.Axes.Left.Maximum:=15;}

  //option 2
  Chart1.Axes.Bottom.SetMinMax(10,15);
  Chart1.Axes.Left.SetMinMax(10,15);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply