Percent Indicators Library

Library Overview

The Percent Indicators library contains controls designed to display percentages and ratios. The library provides:

  • Display elements — sector of circle, portion of rectangle, multiple portions

  • Preconfigured controls — Dynamic Pie, Pie Chart, Simple Light Blue

  • Custom controls — Generic Percent

The Generic Percent and Simple Light Blue blocks are probably the most useful blocks in this library. By default, these blocks reflect scalar input values between 0 and 100 by coloring a corresponding segment of a linear scale. By customizing the blocks, you can also have them display an input value X between m and M as the percentage 100 * ((X - m) / (M - m)).

Customizing Percent Indicators

The table below lists some common ways to customize a block in the Percent Indicators library, using its ActiveX® Control Properties dialog box.

TaskDescription
Use a radial percentage scale that reflects the input as a sector of a circleOn the Misc. panel, set DisplayMode to Radial. Use the StartAngle value to indicate where the sector begins; a value of 0 corresponds to a vertical radius above the circle's center, while a value of 90 corresponds to a horizontal radius to the right of the circle's center.
Change the direction in which a radial percentage scale increasesOn the Misc. panel, use the Direction property to reverse the scale's polarity. If Direction is set to Forward, then the scale increases clockwise.
Use a linear percentage scale that reflects the input as a portion of a rectangleOn the Misc. panel, set DisplayMode to Linear.
Change the direction in which a linear percentage scale increasesOn the Misc. panel, use the Orientation property to indicate whether the linear scale is horizontal or vertical. Use the Direction property to reverse the scale's polarity. If Direction is set to Forward, then a horizontal scale increases to the right and a vertical scale increases downward.
Specify the range to use when converting the input to a percentageOn the Misc. panel, use the Min and Max properties. If the input value is X, then the block displays the percentage:
100 * ((X - Min) / (Max - Min))
.
Display a number near or inside the corresponding colored areaOn the Portions panel, set DigitalStyle to Floating. You can use the DigitalPosition value to vary the position along one dimension (radius in the case of a radial scale, height in the case of a horizontal scale, and horizontal coordinate in the case of a vertical scale).
Display a number in a fixed positionOn the Portions panel, set DigitalStyle to Fixed. To specify the position of the number, first set PortionID to the ID of the portion you want to configure (0 if you are displaying only the scalar input signal) and then use the PortionDigitalX and PortionDigitalY values to indicate the position.

Combining Multiple Regions in One Display

To display multiple regions on a single block, see the customizations in the table below. To learn how to control multiple regions simultaneously, see Controlling Multiple Graphical Elements.

TaskDescription
Add another region to the displayOn the Portions panel, increase the Portions property. The ID of the new region is the Portions property value minus one. To specify properties of the new region, set PortionID to that ID and then set the remaining properties on the dialog box panel accordingly. Note that the DigitalStyle and DigitalFormat properties apply to all regions on the block.
Delete the most recently added region from the displayOn the Portions panel, decrease the Portions property. This deletes all properties associated with the region, such as its color.

Was this topic helpful?