TWorldSeries - Pacific centered map

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
IndOpt
Newbie
Newbie
Posts: 2
Joined: Mon Sep 25, 2017 12:00 am

TWorldSeries - Pacific centered map

Post by IndOpt » Mon May 21, 2018 2:06 pm

How can I use the TWorldSeries for a Pacific centered map, so that it uses 0 to 360 degrees instead of -180 to +180 degrees?

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

Re: TWorldSeries - Pacific centered map

Post by Yeray » Thu May 24, 2018 7:05 am

Hello,

You could use two TWorldSeries. The first one to draw from 0 to 180 and the second one to draw from -180 to 0. Ie:

Code: Select all

uses TeeWorldSeries;

var Series1: TWorldSeries;

procedure TForm1.FormCreate(Sender: TObject);
var tmpSeries: TWorldSeries;
begin
  Chart1.View3D:=False;
  Chart1.Legend.Hide;

  Series1:=Chart1.AddSeries(TWorldSeries) as TWorldSeries;
  Series1.FillSampleValues();


  with Chart1.Axes.Bottom do
  begin
    EndPosition:=50;
    SetMinMax(0, 180);
  end;

  tmpSeries:=CloneChartSeries(Series1) as TWorldSeries;
  with Chart1.CustomAxes.Add do
  begin
    Horizontal:=True;
    StartPosition:=50;
    SetMinMax(-180, 0);
  end;
  tmpSeries.CustomHorizAxis:=Chart1.CustomAxes[0];

  tmpSeries.ParentChart:=nil;
  Chart1.AddSeries(tmpSeries);
end;
Project3_2018-05-24_09-04-45.png
Project3_2018-05-24_09-04-45.png (75.16 KiB) Viewed 4450 times
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

IndOpt
Newbie
Newbie
Posts: 2
Joined: Mon Sep 25, 2017 12:00 am

Re: TWorldSeries - Pacific centered map

Post by IndOpt » Thu Jun 07, 2018 1:10 pm

Thanks,
How can I add a shortest distance line from a position in Australia to a position on the west coast of the US, for example from Sydney to San Francisco, using this Pacific centered map?

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

Re: TWorldSeries - Pacific centered map

Post by Yeray » Wed Jun 13, 2018 1:27 pm

Hello,

Do you mean how to calculate the great-circle distance or do you mean how to choose between the distance of two points in the same series or from a series to the other? For the later, once you have both distances you only have to take the shortest.

If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
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