TPolarBarSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Sean
Newbie
Newbie
Posts: 5
Joined: Mon May 17, 2004 4:00 am

TPolarBarSeries

Post by Sean » Tue Jun 08, 2004 4:09 pm

Hi, I'm trying to plot a PolarBarSeries of wave data which comprises of wave direction in degrees (the Angle) against wave height in meters (the Radius). The problem I have is that the directional component is being plotted anticlockwise even when I set the series labels to clockwise.
Is there any way to get the direction(Angle) to increment clockwise from north so that 0 deg is north, 90 deg it east, 180 is south and 270 is west.

Regards,
Sean Palmer.

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jun 09, 2004 4:24 pm

Hi Sean,

you can do this :

Code: Select all

Series1.CircleLabels := true;
Series1.ClockWiseLabels := true;
Series1.RotationAngle := 90;

Sean
Newbie
Newbie
Posts: 5
Joined: Mon May 17, 2004 4:00 am

Post by Sean » Thu Jun 10, 2004 10:25 am

Hi Pep,

That's exactly how I have the series parameters set already, the labels are displaying correctly but the data is still displaying the directions anti-clockwise.
If I plot an angle of 299 degrees and radius of 1.0 the PolatBarSeries visually plots the angle at 61 degrees.

Cheers,
Sean.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Thu Jun 10, 2004 3:31 pm

Hi, Sean.

You can use series OnAfterAdd event to "transform" values from acw to cw. This involves the following operation:
angle = 360 - angle

Something like this:

Code: Select all

procedure TForm1.Series1AfterAdd(Sender: TChartSeries;
  ValueIndex: Integer);
begin
    Sender.XValue[ValueIndex] := 360 - Sender.XValue[ValueIndex];
end;
Marjan Slatinek,
http://www.steema.com

Sean
Newbie
Newbie
Posts: 5
Joined: Mon May 17, 2004 4:00 am

Post by Sean » Thu Jun 10, 2004 3:59 pm

Hi Marjan,

Thanks for that, I was basically doing the same but on a calculated field in the dataset.

The point that I think should be raised is that if Series1.ClockWiseLabels is set to true, then the dataset should automatically be converted from acw to cw.

Cheers,
Sean.

Post Reply