Class LinearScale
Represents the linear scale. To render this scale, create an instance of LinearScale class, and set required properties.
Inheritance
Namespace: Syncfusion.SfGauge.XForms
Assembly: Syncfusion.SfGauge.XForms.dll
Syntax
public class LinearScale : Element, IThemeElement
Constructors
LinearScale()
Initializes a new instance of the LinearScale class to set required linear scale properties in linear gauge.
Declaration
public LinearScale()
Fields
CornerRadiusProperty
Gets or sets a corner radius property value for linear scale to draw the scale with rounded corners in linear gauge.
Declaration
public static readonly BindableProperty CornerRadiusProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CornerRadiusTypeProperty
Corner radius property.
Declaration
public static readonly BindableProperty CornerRadiusTypeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CultureProperty
Gets or sets the culture value. It changes the culture value of label in linear scale.
Declaration
public static readonly BindableProperty CultureProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CustomLabelsProperty
The custom labels property.
Declaration
public static readonly BindableProperty CustomLabelsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
FontAttributesProperty
Gets or sets the font attributes for linear scale. It changes the font style for the linear gauge scale. This is bindable property.
Declaration
public static readonly BindableProperty FontAttributesProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
FontFamilyProperty
Gets or sets the font family of the text. It changes the font family of scale text in linear gauge. This is a bindable property.
Declaration
public static readonly BindableProperty FontFamilyProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
FrameOffsetProperty
Gets or sets the FrameOffset property of linear scale. It changes the frame offset for linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty FrameOffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
GradientStopsProperty
Gets or sets a collection of the GradientColor properties in linear range. This is a bindable property.
Declaration
public static readonly BindableProperty GradientStopsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
IntervalProperty
Gets or sets the Interval property of the linear scale. The default interval of scale is auto interval. This is a bindable property.
Declaration
public static readonly BindableProperty IntervalProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelColorProperty
Gets or sets the LabelColor property of linear scale. It changes the label color for linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty LabelColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelFontProperty
Gets or sets the LabelFont property of linear scale. It changes the label font for linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty LabelFontProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelFontSizeProperty
Gets or sets the LabelFontSize of linear scale. It changes the font of label for linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty LabelFontSizeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelFormatProperty
Gets or sets the LabelFormat property of linear scale. It changes the label format for linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty LabelFormatProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelOffsetProperty
Gets or sets the LabelOffset of linear scale. It changes the offset of label for linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty LabelOffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelPostfixProperty
Gets or sets the LabelPostfix property of linear scale. It is used to postfix the values to scale labels.
Declaration
public static readonly BindableProperty LabelPostfixProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelPrefixProperty
Gets or sets the LabelPrefix property of the linear scale. It is used to prefix the values to scale labels.
Declaration
public static readonly BindableProperty LabelPrefixProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MajorTickSettingsProperty
Gets or sets the MajorTickSettings property of linear scale. It customizes the major ticks of a linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty MajorTickSettingsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MaximumLabelsProperty
Gets or sets the MaximumLabels property of linear scale. It shows the maximum labels of linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty MaximumLabelsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MaximumValueProperty
Gets or sets the MaximumValue property of linear scale. It represesnts the scale maximum value. This is a bindable property.
Declaration
public static readonly BindableProperty MaximumValueProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MinimumValueProperty
Gets or sets the MinimumValue property of the linear scale. It represents the minimum value of a linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty MinimumValueProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MinorTickSettingsProperty
Gets or sets the MinorTickSettings property of linear scale. It customizes the minor ticks of a linear scale. This is a bindable property.
Declaration
public static readonly BindableProperty MinorTickSettingsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
MinorTicksPerIntervalProperty
Gets or sets the MinorTicksPerInterval property of linear scale. The default interval of scale is auto interval.
Declaration
public static readonly BindableProperty MinorTicksPerIntervalProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
OffsetProperty
The offset property.
Declaration
public static readonly BindableProperty OffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
OpposedPositionProperty
The opposedPosition property.
Declaration
public static readonly BindableProperty OpposedPositionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
PointersProperty
Gets or sets the Pointers property of the linear scale. Pointers are used to mark values. This is a bindable property.
Declaration
public static readonly BindableProperty PointersProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
RangesProperty
Gets or sets the Ranges property of the linear scale. Range is a visual element, which begins and ends at the specified values within a scale.
Declaration
public static readonly BindableProperty RangesProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ScaleBarColorProperty
The scale bar color property.
Declaration
public static readonly BindableProperty ScaleBarColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ScaleBarLengthProperty
The scale bar length property.
Declaration
public static readonly BindableProperty ScaleBarLengthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ScaleBarSizeProperty
The scale bar size property.
Declaration
public static readonly BindableProperty ScaleBarSizeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ScaleOffsetProperty
Gets or sets the value of ScaleOffset. This is a bindable property.
Declaration
public static readonly BindableProperty ScaleOffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ScalePositionProperty
The scale position property.
Declaration
public static readonly BindableProperty ScalePositionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ShowLabelsProperty
The show labels property.
Declaration
public static readonly BindableProperty ShowLabelsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ShowTicksProperty
The show ticks property.
Declaration
public static readonly BindableProperty ShowTicksProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
CornerRadius
Gets or sets a corner radius value for linear scale to draw the scale with rounded corners in linear gauge.
Declaration
public double CornerRadius { get; set; }
Property Value
Type |
---|
System.Double |
CornerRadiusType
Gets or sets a corner radius to draw the linear scale with rounded corner.
Declaration
public CornerRadiusType CornerRadiusType { get; set; }
Property Value
Type |
---|
CornerRadiusType |
Culture
Gets or sets the culture value. It changes the culture value of label in linear scale.
Declaration
public CultureInfo Culture { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo | The default value is CultureInfo.CurrentCulture. |
Examples
This sample shows how to set the Culture for the label.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.Culture = new System.Globalization.CultureInfo("fr-FR");
gauge.Scales.Add(scale);
CustomLabels
Gets or sets the custom labels for linear scale. To render this scale, create an instance of CustomLabels class, and set required properties.
Declaration
public double[] CustomLabels { get; set; }
Property Value
Type |
---|
System.Double[] |
FontAttributes
Gets or sets the font attributes for linear scale. It is used to change the font style for the linear gauge scale.
Declaration
public FontAttributes FontAttributes { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.FontAttributes | This property takes the FontAttributesvalue. |
FontFamily
Gets or sets the font family of the text. It is used to change the font family of scale text in linear gauge.
Declaration
public string FontFamily { get; set; }
Property Value
Type | Description |
---|---|
System.String | The font family of the text. |
FrameOffset
Gets or sets the FrameOffset of linear scale. It changes the frame offset for linear scale. This is a bindable property.
Declaration
public double FrameOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the FrameOffset for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.FrameOffset = 0.2;
gauge.Scales.Add(scale);
}
GradientStops
Gets or sets a collection of the GradientColor properties in linear range. This is a bindable property.
Declaration
public ObservableCollection<GaugeGradientStop> GradientStops { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<GaugeGradientStop> |
Interval
Gets or sets the Interval property of the linear scale. The default Interval of scale is auto interval.
Declaration
public double Interval { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the Interval for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.Interval = 10;
gauge.Scales.Add(scale);
}
LabelColor
Gets or sets the LabelColor of linear scale. It changes the label color for linear scale. This is a bindable property.
Declaration
public Color LabelColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color as value. |
Examples
This sample shows how to set the LabelColor for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.LabelColor = Color.Red;
gauge.Scales.Add(scale);
}
LabelFont
Gets or sets the LabelFont property of linear scale. It changes the label font for linear scale. This is a bindable property.
Declaration
public Font LabelFont { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Font | This property takes the Xamarin.Forms.Font as value. |
Examples
This sample shows how to set the LabelFont for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.LabelFont = new Font();
gauge.Scales.Add(scale);
}
LabelFontSize
Gets or sets the LabelFontSize of linear scale. It is used to change the font of label for linear scale.
Declaration
public double LabelFontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the LabelFontSize for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.LabelFontSize = 14;
gauge.Scales.Add(scale);
}
LabelFormat
Gets or sets the LabelFormat of linear scale. It changes the label format for linear scale. This is a bindable property.
Declaration
public string LabelFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property takes the System.String as value. |
Examples
This sample shows how to set the LabelFormat for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.LabelFormat = "Money:{0:c}";
gauge.Scales.Add(scale);
LabelOffset
Gets or sets the LabelOffset of linear scale. It changes the offset of label for linear scale. This is a bindable property.
Declaration
public double LabelOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the LabelOffset for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.LabelOffset = 0.8;
gauge.Scales.Add(scale);
}
LabelPostfix
Gets or sets the LabelPostfix of the linear scale. It is used to postfix the values to scale labels. This is a bindable property.
Declaration
public string LabelPostfix { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property takes the System.Double as value. |
Examples
This sample shows how to set the LabelPostfix for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.LabelPostfix = "%";
gauge.Scales.Add(scale);
}
LabelPrefix
Gets or sets the LabelPrefix of linear scale. It is used to prefix the values to scale labels. This is a bindable property.
Declaration
public string LabelPrefix { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property takes the System.String as value. |
Examples
This sample shows how to set the LabelPrefix for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.LabelPrefix = "$";
gauge.Scales.Add(scale);
}
MajorTickSettings
Gets or sets the MajorTickSettings of linear scale. It customizes the major ticks of a linear scale. This is a bindable property.
Declaration
public LinearTickSettings MajorTickSettings { get; set; }
Property Value
Type | Description |
---|---|
LinearTickSettings | This property takes the TickSettings as value. |
Examples
This sample shows how to set the MajorTickSettings for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.MajorTickSettings = new TickSettings();
gauge.Scales.Add(scale);
}
MaximumLabels
Gets or sets the MaximumLabels property of linear scale. It shows the maximum labels of linear scale. This is a bindable property.
Declaration
public int MaximumLabels { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | This property takes the System.Int32 as value. |
Examples
This sample shows how to set the MaximumLabels for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.MaximumLabels = 3;
gauge.Scales.Add(scale);
}
MaximumValue
Gets or sets the MaximumValue of linear scale. It represesnts the scale maximum value. This is a bindable property.
Declaration
public double MaximumValue { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the MaximumValue for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.MaximumValue = 100;
gauge.Scales.Add(scale);
}
MinimumValue
Gets or sets the MinimumValue of linear scale. It represents the minimum value of a linear scale. This is a bindable property.
Declaration
public double MinimumValue { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the MinimumValue for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.MinimumValue = 0;
gauge.Scales.Add(scale);
}
MinorTickSettings
Gets or sets the MinorTickSettings of linear scale. It customizes the minor ticks of a linear scale. This is a bindable property.
Declaration
public LinearTickSettings MinorTickSettings { get; set; }
Property Value
Type | Description |
---|---|
LinearTickSettings | This property takes the TickSettings as value. |
Examples
This sample shows how to set the MinorTickSettings for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.MinorTickSettings = new TickSettings();
gauge.Scales.Add(scale);
}
MinorTicksPerInterval
Gets or sets the MinorTicksPerInterval of linear scale. The default interval property of scale is auto interval. This is bindable property.
Declaration
public double MinorTicksPerInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the MinorTicksPerInterval for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.MinorTicksPerInterval = 3;
gauge.Scales.Add(scale);
}
Offset
Gets or sets the Offset of the linear scale. This is a bindable property.
Declaration
public double Offset { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the Offset for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.Offset = 0.2;
gauge.Scales.Add(scale);
}
OpposedPosition
Gets or sets the OpposedPosition of the linear scale. This is a bindable property.
Declaration
public bool OpposedPosition { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the System.Boolean as value. |
Pointers
Gets or sets the Pointers property of the linear scale. Pointers are used to mark values. This is a bindable property.
Declaration
public List<LinearPointer> Pointers { get; set; }
Property Value
Type |
---|
System.Collections.Generic.List<LinearPointer> |
Ranges
Gets or sets the Ranges property of the linear scale. Range is a visual element, which begins and ends at the specified values within a scale.
Declaration
public List<LinearRange> Ranges { get; set; }
Property Value
Type |
---|
System.Collections.Generic.List<LinearRange> |
ScaleBarColor
Gets or sets the ScaleBarColor of linear scale. To render this, create an instance of ScaleBarcolor and set required properties. This is a bindable property.
Declaration
public Color ScaleBarColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | This property takes the Xamarin.Forms.Color as value. |
Examples
This sample shows how to set the ScaleBarColor for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.ScaleBarColor = Color.Red;
gauge.Scales.Add(scale);
}
ScaleBarLength
Gets or sets the ScaleBarLength of linear scale. To render this, create an instance of ScaleBarLength and set required properties. This is a bindable property.
Declaration
public double ScaleBarLength { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the ScaleBarLength for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.ScaleBarLength = 100;
gauge.Scales.Add(scale);
}
ScaleBarSize
Gets or sets the ScaleBarSize of linear scale. To render this, create an instance of ScaleBarSize and set required properties. This is a bindable property.
Declaration
public double ScaleBarSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the System.Double as value. |
Examples
This sample shows how to set the ScaleBarSize for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.ScaleBarSize = 13;
gauge.Scales.Add(scale);
}
ScaleOffset
Gets or sets the value of ScaleOffset. It is used to customize the spacing of linear scale.
Declaration
public double ScaleOffset { get; set; }
Property Value
Type |
---|
System.Double |
ScalePosition
Gets or sets the ScalePosition of linear scale. It shows the scale position of linear scale. This is a bindable property.
Declaration
public ScalePosition ScalePosition { get; set; }
Property Value
Type | Description |
---|---|
ScalePosition | This property takes the ScalePosition as value. |
Examples
This sample shows how to set the MinimumValue for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.ScalePosition = ScalePosition.Forward;
gauge.Scales.Add(scale);
}
ShowLabels
Gets or sets the ShowLabel property. It shows the labels of linear scale. This is a bindable property.
Declaration
public bool ShowLabels { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the System.Boolean as value. |
Examples
This sample shows how to set the ShowLabels for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.ShowLabels = true;
gauge.Scales.Add(scale);
}
ShowTicks
Gets or sets the ShowTicks property of linear scale. It shows the ticks of linear scale. This is a bindable property.
Declaration
public bool ShowTicks { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the System.Boolean as value. |
Examples
This sample shows how to set the ShowTicks for the gauge.
void MyPage()
{
SfLinearGauge gauge = new SfLinearGauge();
LinearScale scale = new LinearScale();
scale.Ticks = true;
gauge.Scales.Add(scale);
}
Methods
OnBindingContextChanged()
Method used to binding context.
Declaration
protected override void OnBindingContextChanged()