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

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Steve Chamberlain
Newbie
Newbie
Posts: 15
Joined: Mon Nov 20, 2006 12:00 am
Location: The Netherlands
Contact:

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

Post by Steve Chamberlain » Tue Aug 21, 2007 8:27 am

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?

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

Post by Yeray » Tue Aug 21, 2007 9:09 am

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.
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

Steve Chamberlain
Newbie
Newbie
Posts: 15
Joined: Mon Nov 20, 2006 12:00 am
Location: The Netherlands
Contact:

Post by Steve Chamberlain » Tue Aug 21, 2007 9:16 am

Thanks for the advice, I will try it this way and let you know how I get on.

Steve Chamberlain
Newbie
Newbie
Posts: 15
Joined: Mon Nov 20, 2006 12:00 am
Location: The Netherlands
Contact:

Post by Steve Chamberlain » Wed Aug 22, 2007 6:16 am

That works a treat! Thanks for the tip.

Post Reply