corelibraries-devexpress-dot-xtragauges-dot-core-dot-model-62031429.md
Represents a custom range for a linear gauge.
Namespace : DevExpress.XtraGauges.Core.Model
Assembly : DevExpress.XtraGauges.v25.2.Core.dll
NuGet Package : DevExpress.Gauges.Core
public class LinearScaleRange :
ScaleRange
Public Class LinearScaleRange
Inherits ScaleRange
See Scales, to learn more.
The following code shows how to add custom ranges to a linear gauge.
Two ranges are added to the LinearScale.Ranges collection. These are used to mark values from 0 to 300 in green, and values between 300 and 500 in red. The result is displayed below:
using DevExpress.XtraGauges.Core.Model;
using DevExpress.XtraGauges.Core.Drawing;
linearScaleComponent1.BeginUpdate();
// Range 1.
LinearScaleRange range1 = new LinearScaleRange();
range1.AppearanceRange.ContentBrush = new SolidBrushObject(Color.Red);
range1.StartValue = 300F;
range1.EndValue = 510F;
range1.ShapeOffset = -5F;
// Range 2.
LinearScaleRange range2 = new LinearScaleRange();
range2.AppearanceRange.ContentBrush = new SolidBrushObject(Color.Lime);
range2.StartValue = 0F;
range2.EndValue = 300F;
range2.ShapeOffset = -5F;
// Add the ranges to the scale.
linearScaleComponent1.Ranges.AddRange(new IRange[] {range1, range2 } );
linearScaleComponent1.EndUpdate();
Imports DevExpress.XtraGauges.Core.Model
Imports DevExpress.XtraGauges.Core.Drawing
linearScaleComponent1.BeginUpdate()
' Range 1.
Dim range1 As LinearScaleRange = New LinearScaleRange()
range1.AppearanceRange.ContentBrush = New SolidBrushObject(Color.Red)
range1.StartValue = 300F
range1.EndValue = 510F
range1.ShapeOffset = -5F
' Range 2.
Dim range2 As LinearScaleRange = New LinearScaleRange()
range2.AppearanceRange.ContentBrush = New SolidBrushObject(Color.Lime)
range2.StartValue = 0F
range2.EndValue = 300F
range2.ShapeOffset = -5F
' Add the ranges to the scale.
linearScaleComponent1.Ranges.AddRange(New IRange() {range1, range2 })
linearScaleComponent1.EndUpdate()
Object BaseObject DevExpress.XtraGauges.Core.Base.BaseObjectEx BaseRange ScaleRange LinearScaleRange
See Also