Place gauge needle beyond y-axis when value is too large
When the gauge y-axis range is set from -50 to 50 and the actual value is 60, then the needle stops at 50.
However, it would be preferred that the needle is put slightly BEYOND the 50 to indicate that the value is actually outside the y-axis range.
this will prevent the user from accidentally thinking the value is 50.
Impemented the overshoot option that takes the number of degrees to overshoot
http://jsfiddle.net/highcharts/gEGaf/2/
-
Nasri commented
hi.. plz i want to click to the dial and move it to select some values here thank you for your help
-
Hans Roerdinkholder commented
Excellent Torstein, exactly what we needed! Thank you for the effort.
-
Thanks for your input, it is implemented now.
-
Hans Roerdinkholder commented
Hello Torstein,
The proposed hack does work for values that surpass the chart's max, but it doesn't work for values that are below the chart's minimum value. Simply applying the same hack on the startAngleRad produces incorrect results for all values that are above the minimum, since yAxis.startAngleRad is used to offset the needle's rotation in the translate function. A proper fix for this scenario would produce consistent behavior for both undershooting and overshooting values.Is there any chance an attribute can be added for this? Something along the lines of plotOptions.gauge.wrap? (Which could also be extended to accept a (radial) value in addition to boolean values, to set a hard limit on the amount of overshoot that is tolerated.)
-
You're correct, it either stops at the endAngle, or wraps around.
One way to hack this would be to temporarily increase the Y axis's endAngleRad property while the pivot is translated: http://jsfiddle.net/highcharts/gEGaf/
-
Hans Wijnveen commented
Hi Torstein, thanks for the reply! I'm not sure I get this right. See http://jsfiddle.net/ZWDT4/1/, where the initial value is 60. The needle stops at 50, but my request is that the needle moves slightly BEYOND 50, say, 55 to indicate that the actual value is not 50 but something out of the y-axis range.
I don't think it works like that currently?