Sub OnGetLabelText(Sender: Object; Args: IUiChartGetTextEventArgs);
Begin
//set of operators
End Sub OnGetLabelText;
Sender. Parameter returning the component that has generated the event.
Args. Parameter that enables to determine event parameters.
The OnGetLabelText event enables to determine custom format of data displayed in data labels. This event occurs when a chart is drawn.
This example assumes that there is the Chart object of the IChart type, that should display data labels, for which custom data format is set.
If required, displaying of data labels of data series and setting up custom data format for these labels can be implemented by running the following commands:
«Chart.Series.DisplayLabels := True;
Chart.Series.DefaultLabel.DataFormat := "%Data";»
Sub UiChartOnGetLabelText(Sender: Object; Args: IUiChartGetTextEventArgs);
Begin
Args.Result := True;
Args.Text := "P" + Args.PointIndex.ToString;
End Sub UiChartOnGetLabelText;
After executing the example chart data labels display "P" and the number of the series point next to it.
See also:
UiChart | IChartSeries.DefaultLabel | IChartSeries.DisplayLabels