I’m trying to make a gauge for wind direction, I haven’t come very far, so don’t mind all that’s lacking at the moment:
The problem I’m having is that they way they solve having a gauge that goes 360° is to use a custom formatter
that is a JavaScript callback, to make sure that one of the axis labels don’t overlap. If you want to make a clock for example, you don’t want 0
and 12
to be printed in the same place, the issue is the same with a compass - you don’t want 0
and 360
degrees to be printed in the same spot.
Basically, it’s done like this:
axisLabel: {
fontSize: 20,
distance: 25,
formatter: function (value) {
if (value === 0) {
return '';
}
return value + '';
}
}
This has been mentioned in other, now closed, topics, but I haven’t found a way to get around it, even with the “undocumented and unsupported” JavaScript workarounds. I’m no expert in exploiting loopholes in the whole YAML → JSON conversion thing, so maybe I haven’t tried the correct “hack”, but, I can’t seem to get past this.
I’m not necessarily looking for a JavaScript solution, if there are other clever way of preventing the labels from overlapping I’m happy with that too.
Any ideas?