- 3 minutes to read
This document provides you with information on what Linear Gauge types are exist in XtraGauges Suite and explains how you can use these gauges in your application.
For details on other gauge types, refer to the corresponding topics of the Gauge Types section.
Linear Gauges Overview
Linear Gauge is a component that represents visual elements on a linear scale.
You can use this control in different applications for creating thermometers, indicators.
The XtraGauges Suite provides Linear Gauges of two types: vertical and horizontal.
A full set of linear gauge shapes is available at design time in the gauge Preset Manager.
Linear Gauge is represented by an instance of the LinearGauge class. This object can be accessed as an item of the GaugeCollection object returned by the GaugeControlBase.Gauges property of the GaugeControl object.
See the following code:
You can create a Linear Gauge control either at design time within Visual Studio or programmatically at runtime. The following examples demonstrate how it can be done:
Linear Gauge Elements
This section describes linear gauge elements, as well as gives a brief overview of their properties.
A Linear Gauge allows you to add numerous elements, each of which is intended to perform a specific task.
The following image demonstrates a Linear Gauge containing a full set of elements.
A Scale is the main element of a linear gauge, as the scale defines the axis, along which other elements (level bar, marker, background layer, etc) are arranged. A linear gauge can have one or more scales displaying tickmarks.
A scale within linear gauges is represented by the LinearScaleComponent class. It provides the following main display options:
- LinearScale.MinValue - specifies the scale’s minimum value.
- LinearScale.MaxValue - specifies the scale’s maximum value.
- LinearScale.Value - specifies the scale’s current value, indicated along the scale by a related value indicator or state (state image) indicator.
- LinearScale.StartPoint and LinearScale.EndPoint - specify the starting and ending point of the scale, in relative coordinates.
- LinearScale.MajorTickCount and LinearScale.MinorTickCount - specify the number of major and minor tickmarks.
- LinearScale.MajorTickmark and LinearScale.MinorTickmark - provide various options controlling the display of major and minor tickmarks.
The Level Bar indicates the current value by filling a bar along the scale’s axis. Typically, there is only one level bar in a linear gauge, and it indicates the current value. The level bar must be associated with a particular scale. Once it has been associated with a scale, it automatically fills a bar along that scale, starting at the scale’s minimum value and extending to the scale’s current value.
A level bar is represented by the LinearScaleLevelComponent class. It provides the following main display options:
- LinearScaleLevel.ShapeType - allows you to choose the level bar’s painting style.
A Background Layer represents the background of the gauge. It is represented by the LinearScaleBackgroundLayerComponent class. This visual element provides the following main options:
- LinearScaleBackgroundLayer.ScaleStartPos and LinearScaleBackgroundLayer.ScaleEndPos - specify the position of the scale’s axis relative to the background layer.
- LinearScaleBackgroundLayer.ShapeType - allows you to choose the background layer’s painting style.
For more information on gauge elements, see the Visual Elements section.