ChartDirector 7.1 (C++ Edition)

MeterPointer.setShapeAndOffset2


Usage

void setShapeAndOffset(IntArray pointerCoor, double startOffset = NoValue, double endOffset = NoValue, double widthRatio = NoValue);

Description

Sets the shape of new style angular meter pointers to a custom polygon.

The custom polygon is specified as a list of numbers representing the (x, y) coordinates of the polygon vertices, with the x-axis pointing from left to right and the y-axis pointing from bottom to top. The direction of the pointer should be pointing upwards, with the starting point at y = 0, and the ending point at y = 1000.

As an example, the coordinates of the new style triangular pointer are:

-15, 0, 15, 0, 0, 1000, 1000

The coordinates for the new style line pointer are:

-5, 0, 5, 0, 5, 1000, -5, 1000

In actual usage, ChartDirector will rotate the polygon to point it to the desired value, and adjust the polygon size and position based on the startOffset, endOffset and widthRatio arguments. Please refer to MeterPointer.setShapeAndOffset2 for the meaning of these arguments.

Arguments

ArgumentDefaultDescription
pointerCoor(Mandatory)An array of numbers x0, y0, x1, y1, x2, y2, ..., representing the coordinates the polygon vertices.
startOffsetNoValueThe position of the starting point as a ratio to the scale radius. NoValue means the position is automatically determined.
endOffsetNoValueThe position of the ending point as a ratio to the scale radius. NoValue means the position is automatically determined.
widthRatioNoValueThe width of the pointer relative to the default width. NoValue means the width is automatically determined.

Return Value

None