MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LinearRange

    Show / Hide Table of Contents

    Class LinearRange

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

    Inheritance
    System.Object
    LinearRange
    Namespace: Syncfusion.Maui.Gauges
    Assembly: Syncfusion.Maui.Gauges.dll
    Syntax
    public class LinearRange : BindableObject
    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange StartValue="10" EndValue="90"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    Constructors

    LinearRange()

    Initializes a new instance of the LinearRange class.

    Declaration
    public LinearRange()
    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange StartValue="10"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    Fields

    ChildProperty

    Identifies the Child bindable property.

    Declaration
    public static readonly BindableProperty ChildProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Child bindable property.

    EndValueProperty

    Identifies the EndValue bindable property.

    Declaration
    public static readonly BindableProperty EndValueProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for EndValue bindable property.

    EndWidthProperty

    Identifies the EndWidth bindable property.

    Declaration
    public static readonly BindableProperty EndWidthProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for EndWidth bindable property.

    FillProperty

    Identifies the Fill bindable property.

    Declaration
    public static readonly BindableProperty FillProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Fill bindable property.

    GradientStopsProperty

    Identifies the GradientStops bindable property.

    Declaration
    public static readonly BindableProperty GradientStopsProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for GradientStops bindable property.

    MidWidthProperty

    Identifies the MidWidth bindable property.

    Declaration
    public static readonly BindableProperty MidWidthProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for MidWidth bindable property.

    PositionProperty

    Identifies the Position bindable property.

    Declaration
    public static readonly BindableProperty PositionProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Position bindable property.

    StartValueProperty

    Identifies the StartValue bindable property.

    Declaration
    public static readonly BindableProperty StartValueProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for StartValue bindable property.

    StartWidthProperty

    Identifies the StartWidth bindable property.

    Declaration
    public static readonly BindableProperty StartWidthProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for StartWidth bindable property.

    Properties

    Child

    Gets or sets the child content of a LinearRange.

    Declaration
    public View Child { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.View

    The default value is null.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange MidWidth="50" >
                <gauge:LinearRange.Child>
                    <Label Text="Range" TextColor="White" HorizontalOptions="Center"/>
                </gauge:LinearRange.Child>
            </gauge:LinearRange>
        </gauge:SfLinearGauge.Ranges>
    </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 defines the end value of the range. The default value is 100.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange EndValue="50"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    EndWidth

    Gets or sets the value that specifies the range start width. Specify the values in the logical pixels.

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

    It defines the end width of the range. The default value is 10.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange EndWidth="50"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    Fill

    Gets or sets the brush that paints the interior area of the range.

    Declaration
    public Brush Fill { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    Fill that specifies how the range is painted.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange Fill="Green"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    GradientStops

    Gets or sets a collection of GaugeGradientStop to fill the gradient brush to the gauge range.

    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
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange>
                <gauge:LinearRange.GradientStops>
                    <gauge:GaugeGradientStop Value="0" Color="Red"/>
                    <gauge:GaugeGradientStop Value="100" Color="Green"/>
                </gauge:LinearRange.GradientStops>
            </gauge:LinearRange>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    MidWidth

    Gets or sets the value that specifies the range mid width. Specify the values in the logical pixels.

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

    It defines the end width of the range. The default value is double.NaN.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange MidWidth="50"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    Position

    Gets or sets the value that indicates the position of the range inside, or cross, or outside the axis line.

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

    The default value is Outside.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange Position="Inside"/>
        </gauge:SfLinearGauge.Ranges>
    </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 defines the start value of the range. The default value is 0.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange StartValue="10"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    StartWidth

    Gets or sets the value that specifies the range start width. Specify the values in the logical pixels.

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

    It defines the start width of the range. The default value is 10.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Ranges>
            <gauge:LinearRange StartWidth="50"/>
        </gauge:SfLinearGauge.Ranges>
    </gauge:SfLinearGauge>

    Methods

    OnBindingContextChanged()

    Invoked whenever the binding context of the View changes.

    Declaration
    protected override void OnBindingContextChanged()

    UpdateMidRangePath(PathF, PointF, PointF, PointF)

    Gets the range path to customize the range mid position.

    Declaration
    protected virtual void UpdateMidRangePath(PathF pathF, PointF startPoint, PointF midPoint, PointF endPoint)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.PathF pathF
    Microsoft.Maui.Graphics.PointF startPoint
    Microsoft.Maui.Graphics.PointF midPoint
    Microsoft.Maui.Graphics.PointF endPoint
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved