Skip to main content

How to: Determine whether an Indicator's Value Falls into a Particular Range

In some cases, you need to know whether or not the current value of an indicator belongs to a particular range. This example shows how to create a state indicator that changes its color, depending on the current range.

First, the Circular gauge is created with three ranges and two empty sections. By default, the gauge's needle doesn't belong to any range, so the state indicator is painted as a gray ellipse.

To solve this task it's necessary to handle the RangeBase.IndicatorEnter and RangeBase.IndicatorLeave events in the following way:

- if a needle 'enters' a range, it is painted with the range color;

- if a needle 'leaves' a range, it is painted in gray.

NOTE

In this example, we set the ValueIndicatorBase.IsInteractive property to True, so that you can click on a gauge and manually change the current needle value.