Legend in Gantt-Chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Heiko
Newbie
Newbie
Posts: 1
Joined: Thu Sep 13, 2007 12:00 am
Contact:

Legend in Gantt-Chart

Post by Heiko » Tue Jun 30, 2009 3:49 pm

Dear all,

hope you can help me with a question regarding Gantt-Charts.
I managed to program the Gantt-Chart you find in the attached picture. I used the following code:

Code: Select all

    Series_Gantt_Bricks.AddGanttColor(1,20,40000,'Ingot1',clred);
    Series_Gantt_Bricks.AddGanttColor(22,43,40000,'Ingot1',clred);
    Series_Gantt_Bricks.AddGanttColor(1,25,40001,'Ingot2',clyellow);
    Series_Gantt_Bricks.AddGanttColor(15,26,40002,'Ingot3',clgreen);
(Note: I switched the vertical axis to datetime. Therefore the 40000... values are shown as dates.)

My question: The legend shows 'Ingot1' twice. How can I manage that my legend only adds one entry for each label - no matter how often it appears as a gantt-bar. For examble: Only three entrys (Ingot1, Ingot2, Ingot3) in my example?

Is there a way? Any ideas?
Heiko
Attachments
Gantt.jpg
Simplified Gantt-Chart demonstrates question
Gantt.jpg (78.35 KiB) Viewed 1904 times

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

Re: Legend in Gantt-Chart

Post by Yeray » Wed Jul 01, 2009 8:15 am

Hi Heiko,

I'm afraid that this is not easy to do as the actual legend draws an item for each point (having LegendStyle as lsValues). I want you to know that there is already in the wish list, the possibility to fully customize the legend item by item. But while it's not implemented, I'm afraid that the only I can think is custom drawing text and rectangles to the canvas.
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