ComponentOne Gauges for WinForms
Working with Gauges for WinForms / Gauge Decorators / Decorator Scales
In This Topic
    Decorator Scales
    In This Topic

    There is actually one scale for the whole gauge. It has the fixed minimum and maximum values (see the Minimum and Maximum properties). Neither of decorators can display values out this range. Labels have the ValueOffset and ValueFactor properties that affect conversion of label values to the corresponding text and thus simulate changing the scale.

    The Interval property sets the value interval to draw each tick mark or label. The IntervalWidth property specifies the distance between tick marks or labels in logical coordinates. You should assign one of these properties to graduate the scale. The difference between Interval and IntervalWidth appears if you resize the gauge. The first property maintains the constant value difference between the near tick marks while the actual distance in pixels or logical coordinates may vary. The second property maintains the constant distance regardless of the value difference. This is useful for elements such as a stacked progress bar where the individual tick marks behave as decorative items whose values are not important. The Interval and IntervalWidth properties can be negative to start graduation from the maximum value.

    The From and To properties set the value interval where the decorator can appear. The C1GaugeRange decorator has also these properties. So you can, for example, display a range in the given subinterval, not for the whole scale. The FromPointerIndex and ToPointerIndex allow binding the C1GaugeMultivalueDecorator.From and C1GaugeMultivalueDecorator.To properties to a pointer. Thus, for example, the range's upper bound may depend on the current pointer's value. The same technique works for labels and tick marks as well. The C1GaugeMultivalueDecorator.FromPointerIndex and C1GaugeMultivalueDecorator.ToPointerIndex properties specify an index in the MorePointers collection. If you want to bind to the main pointer assign a large value to these properties, for example, 10000. Setting to a negative value cancels binding.

    The ScaleFrom and ScaleTo properties specify where the decorator scale starts and ends. These properties are necessary because the C1GaugeMultivalueDecorator.From and C1GaugeMultivalueDecorator.To values may vary if they are bound to pointers while the graduation should often be fixed. Also, the location and width of a decorator may change linearly from ScaleFrom to ScaleTo values. By default, these properties have the same values as the From and To properties. It may occur that the From and To values don't coincide with any scale marks. It is possible to display such values using the ShowIrregularFrom and ShowIrregularTo properties.

    A few label or tick mark decorators can be grouped into the sequence. The first decorator in the sequence shows all its values. The second decorator shows all values except those appeared on the first decorator. Each the next decorator shows all values that do not occur in any of the previous decorators. The SequenceNo property specifies the sequence number. C1GaugeLabels and C1GaugeMarks have independent sequences. You may exclude the decorator from any sequences by setting its SequenceNo properties to -1.

    See Also