UiChart.OnGetLabelText

Syntax

Sub OnGetLabelText(Sender: Object; Args: IUiChartGetTextEventArgs);

Begin

//set of operators

End Sub OnGetLabelText;

Parameters

Sender. Parameter that returns the component that has generated the event.

Args. Parameter that enables the user to determine event parameters.

Description

The OnGetLabelText event enables the user to determine a custom format of data displayed in data labels. The event occurs when a chart is rendered.

Example

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, data labels of data series can be displayed and custom data format can be set for these labels by executing the 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