TTChartOnGetNextAxisLabel

type TTChartOnGetNextAxisLabel = procedure(ASender: TObject; Axis, LabelIndex: Integer; Var LabelValue: Double; Var MoreLabels: WordBool) of object;

Type Library
TeeChartx

Description
A TTChartOnGetNextAxisLabel event is used to define custom Axis Labels. Using this event you can customize Axis Labels positions and values.

This event gets called in a loop until you set the MoreLabels parameter to False OR the LabelValue parameter is BIGGER than the Axis Maximum value.

The MoreLabels parameter is False by default, meaning that if it's not set to True the first time this event gets called, TeeChart will draw the default Axis Labels.

The Axis parameter specifies the Axis subcomponent. It can be the Chart atLeft, atRight, atTop or atBottom axis components.

The LabelIndex parameter is an incremental counter for you to know which Label the event is asking for a value.

The LabelValue parameter must be filled with the desired Axis Label value.

You can use the TTChartOnGetAxisLabel event to override the default Axis Labels text with your preferred Axis Label string representation.

Example [Visual Basic]:

Private Sub Form_Load()

With TChart1

.AddSeries scLine

.Series(0).FillSampleValues 10

End With

End Sub

Private Sub TChart1_OnGetNextAxisLabel(ByVal Axis As Long, ByVal LabelIndex As Long, LabelValue As Double, MoreLabels As Boolean)

If Axis = atLeft Then

MoreLabels = True

'Only label if following cases are true

Select Case LabelIndex

Case 0: LabelValue = 11

Case 1: LabelValue = 119

Case 2: LabelValue = 130

Case Else: MoreLabels = False

End Select

End If

End Sub