Page 1 of 1

Polar plot - drawing a line from a point to the origin

Posted: Tue Aug 21, 2007 8:27 am
by 9243129
Hi all,

I have a polar plot with several series, each with several points. These points are joined by lines. The CloseCircle property is switched off, so a line is not drawn between the first and last point. This is desired.

What I would like to do is draw a line from the first and last points to the origin (centre of the polar plot). Is there an easy way to do this? Perhaps a property I can set?

Posted: Tue Aug 21, 2007 9:09 am
by yeray
Hi Steve,

I think you could solve this with simply adding a null point at point (0,0) as follows.

Code: Select all

Series1.AddNullXY(0,0);
Series1.CloseCircle := True;
After that, if you want to hide this point, you should do something similar as follows, using OnGetPointerStyle event:

Code: Select all

function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
  ValueIndex: Integer): TSeriesPointerStyle;
begin
  if (Series1.ValueColor[ValueIndex] = clNone) then
    result := psNothing
  else
    result := psRectangle;
end;
Note that I use the condition "Series1.ValueColor[ValueIndex] = clNone" because adding a null point on a Polar Series, the point is added as a normal point but with color clNone.

Posted: Tue Aug 21, 2007 9:16 am
by 9243129
Thanks for the advice, I will try it this way and let you know how I get on.

Posted: Wed Aug 22, 2007 6:16 am
by 9243129
That works a treat! Thanks for the tip.