UiChart.OnGetCategoryName

Syntax

Sub OnGetCategoryName(Sender: Object; Args: IUiChartCategoryNameEventArgs);

Begin

//set of operators

End Sub OnGetCategoryName;

Parameters

Sender - parameter that returns the component that has generated the event.

Args - parameter that enables the user to determine event parameters.

Description

The OnGetCategoryName event enables the user to determine names of points for category axis. The event occurs when a chart is rendered.

NOTE. Name format can be set using the UiChart.OnGetCategoryFormat event.

Example

This example assumes that there is the UiChart1 object of the UiChart type.

Sub UiChart1OnGetCategoryName(Sender: Object; Args: IUiChartCategoryNameEventArgs);
Begin
    Args.Result := DateTime.AddDays(DateTime.Now, Args.PointIndex);
End Sub UiChart1OnGetCategoryName;

Sub UiChart1OnGetCategoryFormat(Sender: Object; Args: IUiChartCategoryFormatEventArgs);
Begin
    Args.Result := "dddd d MMMM yyyy";
End Sub UiChart1OnGetCategoryFormat;

After executing the example names of points of the category axis are created using the name of the weekday and the date:

See also:

UiChart