
This example demonstrates a round meter.
This example is similar to the Semi-Circle Meter example, but with the angular range set to much wider. There are also more chart formatting and decorations.
First, a basic angular meter is created using the following steps:
- Create an AngularMeter object using AngularMeter.AngularMeter. In this example, the background color is set to silver using silverColor and the meter border is set to have a depressed effect.
- Specify the orientation of the meter using AngularMeter.setMeter. This specifies the center, the radius, and the angular span of the meter.
- Set the numeric scale of the meter using BaseMeter.setScale
- Add a pointer to the meter using BaseMeter.addPointer
- Define zones on the meter using AngularMeter.addZone. In this example, 3 zones (red, yellow and green) are defined.
- Add arbitrary text boxes to the meter using BaseChart.addText. In this example, a text box is added to label the meter as "CPU", and another text box is added to display the data value as text.
- Set the scale and tick and line widths with BaseMeter.setLineWidth. The meter scale line is disabled by setting its line width to 0 (note there is no arc along the scale). The major tick width is set to 2 pixels, so the major ticks are thicker than the minor ticks.
- Add a light blue ring to encircle the meter using AngularMeter.addRing.
- Add a metallic blue circle as the meter face using AngularMeter.addRing.