Chart for .NET / User's Guide / Gauges / Gauge Axes

Gauge Axes

Gauge axes are similar to chart axes and are represented by instances the NGaugeAxis class which derives from the NAxisBase class common for all axis types in the component. The differences between the chart and the gauge axes are two:

1. The range of the chart axes by default is determined by the data of one or more series that scale on the axes. Gauge axes in contrast have a fixed range, because it is assumed that you already have knowledge of the range of data that that the gauge can display.

2. Gauge axes use different axis anchors than chart axes. To learn how to position gauge axes check out the Gauge Axis Anchors topic.

 Gauge Axis Range

The gauge axis has a property called Range that allows you to change the range of values displayed by the axis scale. By default the range is set to [0, 100]. The following code will set the axis range to [0, 1000]:

C#
Copy Code
ChartControl1.Panels.Clear();
NRadialGaugePanel radialGauge = new NRadialGaugePanel(); 
NGaugeAxis axis = (NGaugeAxis)radialGauge.Axes[0];
axis.Range = new NRange1DD(0, 1000); 
nChartControl1.Panels.Add(radialGauge);
nChartControl1.Refresh();
Visual Basic
Copy Code
NChartControl1.Panels.Clear()
Dim radialGauge As New NRadialGaugePanel
Dim axis As NGaugeAxis = CType(radialGauge.Axes(0), NGaugeAxis)
axis.Range = New NRange1DD(0, 1000) 
NChartControl1.Panels.Add(radialGauge)
NChartControl1.Refresh()
 Related Examples

Windows forms: Gauge Gallery\Gauges\Axes

Windows forms: Gauge Gallery\Gauges\Indicators

Web forms: Gauge Gallery\Gauges\Axes

Web forms: Gauge Gallery\Gauges\Indicators

See Also