ITChart.OnGetLegendText
ITChart
property OnGetLegendText: TTChartOnGetLegendText;
Type Library
TeeChartx
Description
You can use this event to override the text strings that Legend paints.
Legend has two principal modes (or LegendStyles):
lsSeries Legend contains Series Names or Titles.
lsValues Legend contains a Series values or labels.
If the LegendStyle is lsAuto, Legend paints in lsSeries mode if more than one Active Series exists in the Chart.
Example [Visual Basic]:
By using this event, you can set the LegendText string parameter to your customized text:
Private Sub TChart1_OnGetLegendText(ByVal LegendStyle As Long, ByVal ValueIndex As Long, LegendText As String)
If LegendStyle = IsSeries Then
LegendText = "My Series #: " & ValueIndex
Else
LegendText = "Value #: " & ValueIndex
End If
End Sub