Skip to main content

CustomDrawSeriesPointEventArgs.LabelText Property

Gets or sets the text of a label for the point currently being painted.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.dll

NuGet Package: DevExpress.Charts

Declaration

public string LabelText { get; set; }

Property Value

Type Description
String

A String representing a label’s text.

Remarks

Use the LabelText property to change the text of a label for the point currently being painted when handling the ChartControl.CustomDrawSeriesPoint event. For a series with points containing two labels, you can also specify the CustomDrawSeriesPointEventArgs.SecondLabelText property.

Note

If the LabelText property is set to Empty or null (Nothing in Visual Basic), this label will be hidden.

Example

Handle the ChartControl.CustomDrawSeriesPoint event to conditionally hide series labels. In the event handler, change the CustomDrawSeriesPointEventArgs.LabelText property value to String.Empty to hide a label.

Note

Handling the WebChartControl.CustomDrawSeriesPoint (ChartControlSettings.CustomDrawSeriesPoint) event is necessary to perform the same for the Chart Control for ASP.NET and MVC.

private void OnCustomDrawSeriesPoint(object sender, CustomDrawSeriesPointEventArgs e) {
    if (e.SeriesPoint.Values[0] < 1) {
        e.LabelText = String.Empty;
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the LabelText property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also