Back to Devexpress

TextStyle Class

mobilecontrols-devexpress-dot-xamarinforms-dot-charts-d31034aa.md

latest3.5 KB
Original Source

TextStyle Class

Stores the text appearance settings.

Namespace : DevExpress.XamarinForms.Charts

Assembly : DevExpress.XamarinForms.Charts.dll

NuGet Package : DevExpress.XamarinForms.Charts

Declaration

csharp
public class TextStyle :
    StyleBase

The following members return TextStyle objects:

Remarks

Assign the TextStyle object with the specified Color and Size settings to the TextStyle property of an object that defines the appearance of the chart’s element. The following objects allow you to configure the text style:

Example

This example demonstrates how to add 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}
    }
};

Implements

INotifyPropertyChanged

Inheritance

Object ChartElement StyleBase TextStyle

See Also

TextStyle Members

DevExpress.XamarinForms.Charts Namespace