Skip to main content

LinearScaleRange Class

Represents a custom range for a linear gauge.

Namespace: DevExpress.XtraGauges.Core.Model

Assembly: DevExpress.XtraGauges.v24.1.Core.dll

NuGet Package: DevExpress.Gauges.Core

Declaration

public class LinearScaleRange :
    ScaleRange

Remarks

See Scales, to learn more.

Example

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:

LinearScale_Ranges_ex

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();

Inheritance

Object
BaseObject
DevExpress.XtraGauges.Core.Base.BaseObjectEx
BaseRange
ScaleRange
LinearScaleRange
See Also