In This Topic
Needle indicators are visualized by radial gauges and represent needles that rotate around the radial gauge center point and point to a scale value.
Creating a Needle Value Indicator
In order to create a knob indicator you must first create an instance of the NNeedleValueIndicator class and then add it to the Indicators collection of the radial gauge:
C# |
Copy Code
|
NNeedleValueIndicator needle = new NNeedleValueIndicator();
radialGauge.Indicators.Add(needle);
|
Needle Value
The needle Value property defines the scale value pointed by the needle. The following code will change the value of a newly created needle indicator:
C# |
Copy Code
|
NNeedleValueIndicator needle = new NNeedleValueIndicator();
needle.Value = 10;
radialGauge.Indicators.Add(needle);
|
Needle Shape
The needle shape is controlled through the needle Shape property accepting values from the ENNeedleShape enum. The following code snippet shows how to change the needle shape:
C# |
Copy Code
|
needle.Shape = ENNeedleShape.Needle4;
|
Needle Appearance
Needle appearance is controlled through the smart shape Fill and Stroke properties. The following code snippet will change the needle filling and stroke to dark green:
C# |
Copy Code
|
needle.Fill = new NColorFill(NColor.DarkGreen);
needle.Stroke = new NStroke(NColor.DarkGreen);
|
Needle Width
The width of the needle is controlled through the Width property of the NNeedleValueIndicator class:
C# |
Copy Code
|
needle.Width = 20;
|
Offset From Center
The offset from center property of the NNeedleValueIndicator controls the offset of the needle begin point from the radial gauge center point. Positive values move the needle begin point closer to the scale whereas negative values mean the opposite. The following code snippet show how to configure the needge indicator so that it starts before the gauge center, crosses and then reaches the scale point:
C# |
Copy Code
|
m_ValueIndicator.OffsetFromCenter = -20;
|