Page 1 of 1

Legend in Gantt-Chart

Posted: Tue Jun 30, 2009 3:49 pm
by 10046690
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

Re: Legend in Gantt-Chart

Posted: Wed Jul 01, 2009 8:15 am
by yeray
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.