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

LinearScaleLabelOptions Class

Contains behavior, layout and data representation options for linear scale labels.

Namespace: DevExpress.Xpf.Gauges

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

Declaration

public class LinearScaleLabelOptions :
    ScaleLabelOptions

The following members return LinearScaleLabelOptions objects:

Remarks

The options provided by a LinearScaleLabelOptions instance can be accessed via the LinearScale.LabelOptions property of a LinearScale object.

To define the behavior of the linear scale labels, use the ScaleLabelOptions.ShowFirst and ScaleLabelOptions.ShowLast properties.

The label’s layout is specified by the LinearScaleLabelOptions.Orientation, ScaleLabelOptions.Offset and ScaleLabelOptions.ZIndex properties.

To customize how data is represented on scale labels, use the ScaleLabelOptions.Addend, ScaleLabelOptions.Multiplier and ScaleLabelOptions.FormatString properties.

For more information on labels, refer to the Labels (Linear Scale) document.

Example

This example illustrates how to create a LinearGaugeControl instance with two LinearScale objects.

<Window x:Class="DXGauges_Linear.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxga="http://schemas.devexpress.com/winfx/2008/xaml/gauges"
        Title="MainWindow" Height="450" Width="525">
    <Grid>
        <dxga:LinearGaugeControl  Name="linearGaugeControl1" Margin="0,24,0,20">
            <dxga:LinearGaugeControl.Model>
                <dxga:LinearRedThermometerModel/>
            </dxga:LinearGaugeControl.Model>
            <dxga:LinearGaugeControl.Scales>
                <dxga:LinearScale StartValue="-40" EndValue="120" 
                                  MajorIntervalCount="8"  Width="60">
                    <dxga:LinearScale.Ranges>
                        <dxga:LinearScaleRange EndValue="32" StartValue="-40">
                            <dxga:LinearScaleRange.Presentation>
                                <dxga:DefaultLinearScaleRangePresentation Fill="LightBlue" />
                            </dxga:LinearScaleRange.Presentation>
                        </dxga:LinearScaleRange>
                        <dxga:LinearScaleRange EndValue="120" StartValue="32">
                            <dxga:LinearScaleRange.Presentation>
                                <dxga:DefaultLinearScaleRangePresentation Fill="Tomato" />
                            </dxga:LinearScaleRange.Presentation>
                        </dxga:LinearScaleRange>
                    </dxga:LinearScale.Ranges>
                    <dxga:LinearScale.CustomLabels>
                        <dxga:ScaleCustomLabel Content="°F" Offset="-45" Value="-45" />
                    </dxga:LinearScale.CustomLabels>
                    <dxga:LinearScale.Layers>
                        <dxga:LinearScaleLayer/>
                    </dxga:LinearScale.Layers>
                    <dxga:LinearScale.LevelBars>
                        <dxga:LinearScaleLevelBar Value="59" />
                    </dxga:LinearScale.LevelBars>
                </dxga:LinearScale>
                <dxga:LinearScale StartValue="-40" EndValue="120" 
                                  MajorIntervalCount="8" Margin="68,0,0,0" >
                    <dxga:LinearScale.Ranges>
                        <dxga:LinearScaleRange StartValue="-40" EndValue="32" >
                            <dxga:LinearScaleRange.Presentation>
                                <dxga:DefaultLinearScaleRangePresentation Fill="LightBlue" />
                            </dxga:LinearScaleRange.Presentation>
                        </dxga:LinearScaleRange>
                        <dxga:LinearScaleRange StartValue="32" EndValue="120" >
                            <dxga:LinearScaleRange.Presentation>
                                <dxga:DefaultLinearScaleRangePresentation Fill="Tomato" />
                            </dxga:LinearScaleRange.Presentation>
                        </dxga:LinearScaleRange>
                    </dxga:LinearScale.Ranges>
                    <dxga:LinearScale.Markers>
                        <dxga:LinearScaleMarker Value="68" />
                    </dxga:LinearScale.Markers>
                    <dxga:LinearScale.CustomLabels>
                        <dxga:ScaleCustomLabel Content="°F" Offset="-7" Value="-45" />
                    </dxga:LinearScale.CustomLabels>
                    <dxga:LinearScale.LabelOptions>
                        <dxga:LinearScaleLabelOptions Offset="3" />
                    </dxga:LinearScale.LabelOptions>
                    <dxga:LinearScale.MinorTickmarkOptions>
                        <dxga:MinorTickmarkOptions Offset="-16" />
                    </dxga:LinearScale.MinorTickmarkOptions>
                </dxga:LinearScale>
            </dxga:LinearGaugeControl.Scales>
        </dxga:LinearGaugeControl>
    </Grid>
</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the LinearScaleLabelOptions class.

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