Page 1 of 1

AddGanttColor - changing color

Posted: Thu May 04, 2006 9:33 am
by 9530384
Hi.

I create some Gantt-Bars using AddGanttColor with different colors which works perfect. But how can I change the color of one of the bars afterwards? Because if I use TChart:Series(0):asGantt:Pointer:Brush:COLOR it applies to all bars in the series...

thanks,

Harry

Posted: Thu May 04, 2006 9:51 am
by narcis
Hi Harry,

You can change it using the OnGetSeriesPointerStyle and something like this:

Code: Select all

Private Sub TChart1_OnGetSeriesPointerStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, AStyle As TeeChart.EPointerStyle)
    If (ValueIndex = 5) Then
        TChart1.Series(SeriesIndex).asGantt.Pointer.Brush.Color = clBlack
    Else
        TChart1.Series(SeriesIndex).asGantt.Pointer.Brush.Color = clTeeColor
    End If
End Sub