WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LinearGaugeRange

    Show / Hide Table of Contents

    Class LinearGaugeRange

    Represents the linear range that used to add color bar in the linear gauge. LinearGaugeRange is a visual element that helps to quickly visualize where a value falls on the axis.

    Inheritance
    System.Object
    LinearGaugeRange
    Namespace: Syncfusion.UI.Xaml.Gauges
    Assembly: Syncfusion.Gauge.WinUI.dll
    Syntax
    public class LinearGaugeRange : Control
    Examples

    The below examples shows, how to add ranges in linear gauge.

    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange StartValue="0"
                                            EndValue="100"
                                            RangePosition="Cross"
                                            StartWidth="5"
                                            EndWidth="5">
                        <gauge:LinearGaugeRange.GradientStops>
                            <gauge:GaugeGradientStop Value="0"
                                                     Color="Green" />
                            <gauge:GaugeGradientStop Value="50"
                                                     Color="Orange" />
                            <gauge:GaugeGradientStop Value="100"
                                                     Color="Red" />
                        </gauge:LinearGaugeRange.GradientStops>
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    Constructors

    LinearGaugeRange()

    Initializes a new instance of the LinearGaugeRange class.

    Declaration
    public LinearGaugeRange()
    Examples

    The below examples shows, how to add ranges in linear gauge.

    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange StartValue="0"
                                            EndValue="100"
                                            RangePosition="Cross"
                                            StartWidth="5"
                                            EndWidth="5">
                        <gauge:LinearGaugeRange.GradientStops>
                            <gauge:GaugeGradientStop Value="0"
                                                     Color="Green" />
                            <gauge:GaugeGradientStop Value="50"
                                                     Color="Orange" />
                            <gauge:GaugeGradientStop Value="100"
                                                     Color="Red" />
                        </gauge:LinearGaugeRange.GradientStops>
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    Fields

    ChildProperty

    Identifies the Child dependency property.

    Declaration
    public static readonly DependencyProperty ChildProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for Child dependency property.

    EndValueProperty

    Identifies the EndValue dependency property.

    Declaration
    public static readonly DependencyProperty EndValueProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for EndValue dependency property.

    EndWidthProperty

    Identifies the EndWidth dependency property.

    Declaration
    public static readonly DependencyProperty EndWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for EndWidth dependency property.

    GradientStopsProperty

    Identifies the GradientStops dependency property.

    Declaration
    public static readonly DependencyProperty GradientStopsProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for GradientStops dependency property.

    MidWidthProperty

    Identifies the MidWidth dependency property.

    Declaration
    public static readonly DependencyProperty MidWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for MidWidth dependency property.

    RangePositionProperty

    Identifies the RangePosition dependency property.

    Declaration
    public static readonly DependencyProperty RangePositionProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for RangePosition dependency property.

    StartValueProperty

    Identifies the StartValue dependency property.

    Declaration
    public static readonly DependencyProperty StartValueProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for StartValue dependency property.

    StartWidthProperty

    Identifies the StartWidth dependency property.

    Declaration
    public static readonly DependencyProperty StartWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for StartWidth dependency property.

    Properties

    Child

    Gets or sets the child content of a LinearGaugeRange.

    Declaration
    public object Child { get; set; }
    Property Value
    Type Description
    System.Object

    An object that contains the range's visual child content. The default value is null.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange EndValue="33"
                                            StartWidth="30"
                                            EndWidth="30"
                                            Background="#FFFE2A25">
                        <gauge:LinearGaugeRange.Child>
                            <TextBlock Text="Slow"
                                       Foreground="White"
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center" />
                        </gauge:LinearGaugeRange.Child>
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    EndValue

    Gets or sets the value that specifies the range end value.

    Declaration
    public double EndValue { get; set; }
    Property Value
    Type Description
    System.Double

    It specifies the end value of the range. Its default value is 0.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange StartValue="10"
                                            EndValue="100">
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    EndWidth

    Gets or sets the value that specifies the range end width.

    Declaration
    public double EndWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The end width of the LinearGaugeRange. The default value is 4.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange EndValue="100"
                                            StartWidth="10"
                                            EndWidth="10">
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    GradientStops

    Gets or sets the collection of GaugeGradientStop that specifies how interior is painted with gradient brush on the LinearGaugeRange.

    Declaration
    public ObservableCollection<GaugeGradientStop> GradientStops { get; set; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ObservableCollection<GaugeGradientStop>

    A collection of the GaugeGradientStop objects associated with the brush, each of which specifies a color and an offset along the axis. The default is an empty collection.

    Examples

    The below examples shows, how to add a collection of gradient stop to the linear range.

    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange StartValue="0"
                                            EndValue="100"
                                            RangePosition="Cross"
                                            StartWidth="5"
                                            EndWidth="5">
                        <gauge:LinearGaugeRange.GradientStops>
                            <gauge:GaugeGradientStop Value="0"
                                                     Color="Green" />
                            <gauge:GaugeGradientStop Value="50"
                                                     Color="Orange" />
                            <gauge:GaugeGradientStop Value="100"
                                                     Color="Red" />
                        </gauge:LinearGaugeRange.GradientStops>
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    MidWidth

    Gets or sets the value that specifies the range mid width.

    Declaration
    public double MidWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The mid width of the LinearGaugeRange, in pixels. The default value is double.NaN.

    Remarks

    Must define the range StartWidth and EndWidth to consider the MidWidth.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange EndValue="100"
                                            StartWidth="10"
                                            MidWidth="25"
                                            EndWidth="10">
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    RangePosition

    Gets or sets the value that indicates the position of the range below or above the axis line for a horizontal linear gauge, or to the right or left of the axis line for a vertical linear gauge.

    Declaration
    public GaugeElementPosition RangePosition { get; set; }
    Property Value
    Type Description
    GaugeElementPosition

    One of the enumeration values that specifies the position of range in the linear gauge. The default is Outside.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange EndValue="100"
                                            StartWidth="10"
                                            MidWidth="25"
                                            EndWidth="10">
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    StartValue

    Gets or sets the value that specifies the range start value.

    Declaration
    public double StartValue { get; set; }
    Property Value
    Type Description
    System.Double

    It specifies the start value of the range. Its default value is 0.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange StartValue="10"
                                            EndValue="100">
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    StartWidth

    Gets or sets the value that specifies the range start width.

    Declaration
    public double StartWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The start width of the LinearGaugeRange. The default value is 4.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.Ranges>
                    <gauge:LinearGaugeRange EndValue="100"
                                            StartWidth="10"
                                            EndWidth="10">
                    </gauge:LinearGaugeRange>
                </gauge:LinearAxis.Ranges>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    Methods

    OnApplyTemplate()

    Invoke to render LinearGaugeRange class.

    Declaration
    protected override void OnApplyTemplate()

    OnCreateAutomationPeer()

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type Description
    Microsoft.UI.Xaml.Automation.Peers.AutomationPeer
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved