Sets the shape of the meter pointer to a custom polygon.
Note: For angular meters, this method is for classical style pointers. There is another method
MeterPointer.setShapeAndOffset2 for setting the shapes and positions of new style pointers.
The custom polygon is specified as a list of numbers representing the (x, y) coordinates of the polygon vertices.
For an angular meter, the polygon should be defined with a nominal dimension of 1000 units. ChartDirector will scale the polygon so that 1000 units will become the radius of the meter.
For a linear meter, the length of the pointer should be defined with a nominal dimension of 1000 units. ChartDirector will scale the polygon so that 1000 units will be the length required for the pointer to reach the meter scale. The width of the pointer will be in 0.1 pixel units (that is, 10 units = 1 pixel).
The coordinate system for defining the polygon is that the x-axis points from left to right, and the y-axis points from bottom to top. The polygon will be defined as a pointer with the pivot at the origin, pointing to the upward direction.
As an example, the coordinates of the standard diamond pointer for an angular meter are:
0, -100, -50, -50, 0, 1000, 50, -50
The coordinates for the standard pencil pointer for a linear meter are:
-30, 0, 30, 0, 30, 768, 0, 1000, -30, 768
After scaling the pointers based on the nominal units, ChartDirector will applies the
lengthRatio and
widthRatio scaling factor to the pointer. These ratios allow you to change the pointer sizes without changing the polygon definition. For example, if you want the meter pointer to be only 80% of the radius in the angular meter, you can set the lengthRatio to 0.80.
© 2021 Advanced Software Engineering Limited. All rights reserved.