ITChart.OnSeriesBeforeDrawValues
ITChart

property OnSeriesBeforeDrawValues: TTChartOnSeriesBeforeDrawValues;

Type Library
TeeChartx

Description
The SeriesBeforeDrawValues event is called just before a specific Series' points are painted. You can then paint on the Chart.Canvas your customized drawings.

WARNING:

Do not change Series properties that would force the Series to be repainted. This may cause recursion and endless repainting !

Example [Visual Basic]:

Private Sub Form_Load()

With TChart1

.Height = 4000

.Width = 6000

.AddSeries scBar

.AddSeries scLine

.AddSeries scPoint

.Series(0).FillSampleValues 6

.Series(1).FillSampleValues 6

.Series(2).FillSampleValues 6

End With

End Sub

Private Sub DrawTheCircle()

With TChart1.Canvas

.Brush.Color = vbYellow

.Brush.Style = bsSolid

.Pen.Color = vbBlue

.Pen.Style = psDot

.Ellipse 80, 80, 290, 160

End With

End Sub

Private Sub Option1_Click()

TChart1.Repaint

End Sub

Private Sub Option2_Click()

TChart1.Repaint

End Sub

Private Sub TChart1_OnSeriesAfterDrawValues(ByVal SeriesIndex As Long)

If Option1.Value = True And SeriesIndex = 0 Then

DrawTheCircle

End If

End Sub

Private Sub TChart1_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)

If Option2.Value = True And SeriesIndex = 0 Then

DrawTheCircle

End If

End Sub