GaugeScale.Direction

Syntax

Direction: Boolean;

Description

The Direction property determines direction of drawing speedometer scale.

Comments

Use JSON or the setDirection method to set the property value, and the getDirection method to get the property value.

If this property is True the scale is drawn clockwise from left to right, otherwise it is drawn counter-clockwise right to left.

Example

To execute the example, the page must contain the Speedometer component named speed1 (see Example of Creating Hand Watch). Indicate that speedometer scales are drawn counter-clockwise. Indicate that sectors offset is set in percents. Get a sector by its name and set an offset from the scale for this sector:

// Get speedometer scale
var scale = speed1.getScales()[0];
// Set counter-clockwise drawing direction
scale.setDirection(False);
speed1.getScales()[1].setDirection(False);
// Indicate that sectors offset is specified in percents
scale.setIsAbsoluteSectorOffset(False);
// Get a sector by its name
var sector = scale.getSectorByName("Sector1")[0];
// Set offset from the scale for this sector
sector.setOffset(0.5);

After executing the example speedometer scales are drawn counter-clockwise. Sectors offsets is specified in percents. An offset from the scale is set for the obtained sector:

See also:

GaugeScale