Page 1 of 1

TMapSeries starting zoom level

Posted: Thu May 20, 2010 4:14 am
by 9236183
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.

Re: TMapSeries starting zoom level

Posted: Thu May 20, 2010 4:56 am
by 9236183
I have manged to work this out by calling zoomrect() in the OnAfterDraw() function.

Re: TMapSeries starting zoom level

Posted: Thu May 20, 2010 2:20 pm
by yeray
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;