TGantt issue

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Friis
Newbie
Newbie
Posts: 23
Joined: Mon May 07, 2012 12:00 am

TGantt issue

Post by Friis » Mon Nov 05, 2012 8:27 am

Hi,

How do I access the individual TGantt point so that I can change the brush, linepen etc??

In the attached photo I would like to give the individual point a different brush color instead of red and different line pen colors instead of just black
Attachments
TGantt.JPG
TGantt.JPG (91.7 KiB) Viewed 3618 times

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

Re: TGantt issue

Post by Yeray » Mon Nov 05, 2012 12:55 pm

Hello,

For the brush, you can set a color when you add the point with the AddGanttColor method that requires a Color as an argument.
Alternatively, you can change a point color after populating the series, ie:

Code: Select all

Series1.ValueColor[3]:=clWhite;
To change a point border line is a bit tricky because it is a unique property for the whole series, not for each point.
You could use the OnGetPointerStyle event to change the series' line pen for each point. Ie:

Code: Select all

function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
  ValueIndex: Integer): TSeriesPointerStyle;
begin
  with (Sender as TGanttSeries).Pointer do
    if (ValueIndex = 2) then
      Pen.Color:=clRed
    else
      Pen.Color:=clBlack;

  Result:=psRectangle;
end;
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