gauge.js
gauge.js copied to clipboard
Line pointer rectangular
Hi,
It is possible to have a line pointer like this ?
Best Fréderik
That's definitely doable. The GaugePointer class is responsible for drawing the pointer, and today it does that roughly like this:
- Draw circle of radius options.pointer.strokeWidth at the center.
- Make a rotated, filled rectangle from center+strokewidth to pointer length and back to center-strokewidth.
Right now the GaugePointer.render() function is hardcoded to do just that. One option could be to generalize this so user can supply their own optional rendering function. This is probably the most flexible alternative. Another approach is to extend the set of options gauge.js has today and let the user choose between different types of pointers (today's triangular shape, rectangular, or others). Personally, I would be in favor of the first approach, though.