Page 1 of 1

Polar plot labels

Posted: Fri Mar 26, 2010 4:15 am
by 10545848
Hello,

I am usint a TPolarSeries and am trying to draw the axis labels from +180 to -180 (or 0) with the 0 at 12 o'clock position, +90 at the 3 o'clock position, 180 at the 6 o'clock position and -90 at the 9 o'clock position. I have set CircleLabels := True, called Rotate(90), and am using the OnGetCircleLabel event. The event code looks like this:

if angle > 180 then
Text:=FloatToStr(Angle-360) + 'º'
else
Text:=FloatToStr(Angle) + 'º'

This properly converts the labels from 0-360 to +/-180. This makes the labels do what I want, but in the opposite direction...meaning -90 is at 3 0'clock and +90 is at 9 o'clock. 0 and 180 are in the correct positions.

How can I get the labels to draw in a clockwise direction instead of a counter clowise direction?

Thanks in advance.

Re: Polar plot labels

Posted: Fri Mar 26, 2010 3:49 pm
by yeray
Hi dpatch,

If I understood well, what about this?

Code: Select all

  if angle >= 180 then
    Text:=FloatToStr(Abs(Angle-360)) + 'º'
  else
    Text:='-'+FloatToStr(Angle) + 'º';