Back to Devexpress

BarSeries.Label Property

maui-devexpress-dot-maui-dot-charts-dot-barseries.md

latest2.4 KB
Original Source

BarSeries.Label Property

Gets or sets settings of bar series labels. This is a bindable property.

Namespace : DevExpress.Maui.Charts

Assembly : DevExpress.Maui.Charts.dll

NuGet Package : DevExpress.Maui.Charts

Declaration

csharp
public BarSeriesLabel Label { get; set; }

Property Value

TypeDescription
BarSeriesLabel

A BarSeriesLabel object that contains bar series label settings.

|

Remarks

Series labels are hidden by default. To display them on a bar chart, create a BarSeriesLabel object, modify label parameters, and assign this label to the Label property.

Example

This example adds series labels to a bar chart, and customize their text pattern, layout and appearance.

xaml
<dxc:ChartView>
    <dxc:ChartView.Series>
        <dxc:BarSeries>
            <dxc:BarSeries.Label>
                <dxc:BarSeriesLabel Position="InsideTop"
                                    Indent="50"
                                    TextPattern="{}{V$.###}">
                    <dxc:BarSeriesLabel.Style>
                        <dxc:SeriesLabelStyle>
                            <dxc:SeriesLabelStyle.TextStyle>
                                <dxc:TextStyle Color="White" Size="24"/>
                            </dxc:SeriesLabelStyle.TextStyle>
                        </dxc:SeriesLabelStyle>
                    </dxc:BarSeriesLabel.Style>
                </dxc:BarSeriesLabel>
            </dxc:BarSeries.Label>
        </dxc:BarSeries>
    </dxc:ChartView.Series>
</dxc:ChartView>
csharp
barSeries.Label = new BarSeriesLabel {
    Position = BarSeriesLabelPosition.InsideTop,
    Indent = 50,
    TextPattern = "{V$.###}",
    Style = new SeriesLabelStyle {
        TextStyle = new TextStyle {Color = Color.White, Size = 24}
    }
};

See Also

BarSeries Class

BarSeries Members

DevExpress.Maui.Charts Namespace