Skip to main content

ScaleLabelOptions.FormatString Property

Gets or sets a value that specifies the format string for the display text on a scale.

Namespace: DevExpress.Xpf.Gauges

Assembly: DevExpress.Xpf.Gauges.v23.2.dll

NuGet Package: DevExpress.Wpf.Gauges


public string FormatString { get; set; }

Property Value

Type Description

A String value that is the format string of a label.


Use the FormatString property to define the specific string format for the scale’s label.

The following images illustrate some of string formats for the Circular Scale:

{0:0} {0:f1} {0:c1}
LabelOptions_StringFormat_0 LabelOptions_StringFormat_f1 LabelOptions_StringFormat_c1

Patterns can comprise plain text and a placeholder {0} with format specifiers. Use a colon to separate a placeholder and its format specifier.

In XAML, insert an escape sequence {} into the beginning of a pattern if it starts with the placeholder. For example: {}{0:0}.


This example shows how to change the arc scale label format and behavior:

Use the following API members to customize labels:

Member Description
ArcScale.LabelOptions Gets or sets the options that specify the position and format for labels displayed on the scale.
ArcScaleLabelOptions Contains appearance and behavior options for arc scale labels.
ArcScaleLabelOptions.Orientation Provides different types of orientation for labels on the Circular scale.
ScaleLabelOptions.FormatString Gets or sets a value that specifies the format string for the display text on a scale.

The markup below configures a gauge that replicates the gauge appearance in the image above:

<Window x:Class="DXGauges_Circular.MainWindow"
        Title="MainWindow" Height="350" Width="525">
        <dxga:CircularGaugeControl Name="circularGaugeControl" 
                <dxga:ArcScale StartValue="0" EndValue="12" 
                               StartAngle="-90" EndAngle="270"
                               MajorIntervalCount="12" MinorIntervalCount="5">
                        <dxga:ArcScaleLabelOptions Orientation="LeftToRight"
                        <dxga:ArcScaleNeedle Value="3">
                                <dxga:ArcScaleNeedleOptions EndOffset="65"/>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FormatString property.


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