CustomDrawSeriesPointEventArgs.LabelText Property

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

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.1.dll

Declaration

public string LabelText { get; set; }
Public Property LabelText As String

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.

Examples

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;
    }
}
See Also