calcOffset ();
The calcOffset method calculates radial offset from the scale center.
To execute the example, the page must contain the Speedometer component named speed1 (see Example of Creating a Fuel Gauge Unit). Add to the page a button, clicking which shows values of speedometer parameters:
<input TYPE="button" VALUE="Calc" ONCLICK="calc()"> <script> function calc() { var arrow = speed1.getScales(0).getArrows(0); var marker = speed1.getCenter(); var str = "GaugeArrowBase.calcRadius() = " + arrow.calcRadius() + "\n"; str += "GaugeMarkerBase.calcSize() = " + marker.calcSize() + "\n"; str += "GaugeMarkerBase.calcOffset() = " + marker.calcOffset() + "\n"; alert(str); } </script>
Clicking the Calc button shows a message that contains values of speedometer parameters, returned by the calcRadius, calcSize, and calcOffset methods:
GaugeArrowBase.calcRadius() = 140
GaugeMarkerBase.calcSize() = 17
GaugeMarkerBase.calcOfset() = 0
See also: