Skip to main content
A newer version of this page is available. .

SeriesBase.LabelsVisibility Property

Specifies whether to show labels for a series.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v21.2.dll

NuGet Package: DevExpress.Charts

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Appearance)]
public DefaultBoolean LabelsVisibility { get; set; }

Property Value

Type Description
DefaultBoolean

True to show series labels; False to hide them; Default - label visibility depends on the series view and chart control type.

Available values:

Name Description
True

true. DefaultBoolean.True has a constant value of 0, while the standard true value corresponds to a value of 1. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

False

false. DefaultBoolean.False has a constant value of 1, while the standard false value corresponds to a value of 0. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

Default

The default behavior determined by the control’s logic.

Remarks

Series point labels are visible in the following cases:

In all other cases, series labels are hidden until you enable them.

The following table shows the LabelsVisibility property in action.

LabelsVisibility = DefaultBoolean.False LabelsVisibility = DefaultBoolean.True
LabelsVisibilityfalse LabelsVisibilitytrue

Example

This example demonstrates how to customize the Side-by-Side Bar series label position and appearance.

Use the following API members to customize bar series labels:

Member Description
Series.LabelsVisibility Specifies whether to show labels for a series.
BarSeriesLabel Defines label settings for bar series.
SeriesLabelBase.BackColor Gets or sets the label’s background color.
SeriesLabelBase.Border Gets the label’s border settings.
SeriesLabelBase.Font Gets or sets the font used to display the label’s contents.
BarSeriesLabel.Position Specifies the position of series point labels, relative to their corresponding Bars.
SeriesLabelBase.TextOrientation Specifies the direction of text within the series labels.
SeriesLabelBase.TextPattern Gets or sets a string which represents the pattern specifying the text to be displayed within series labels.
private void OnFormLoad(object sender, EventArgs e) {
    chartControl1.Series[0].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;

    BarSeriesLabel seriesLabel = chartControl1.Series[0].Label as BarSeriesLabel;
    seriesLabel.BackColor = Color.White;
    seriesLabel.Border.Color = Color.DarkSlateGray;
    seriesLabel.Font = new Font("Tahoma", 10, FontStyle.Regular);
    seriesLabel.Position = BarSeriesLabelPosition.TopInside;
    seriesLabel.TextOrientation = TextOrientation.Horizontal;
    seriesLabel.TextPattern = "{V:F1}";            
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the LabelsVisibility 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