Mikhus / canvas-gauges

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.
http://canvas-gauges.com/
MIT License
1.57k stars 396 forks source link

Change value box location help needed #116

Closed gjt211 closed 5 years ago

gjt211 commented 7 years ago

I have three radial gauges on my page and they are all working well, however I am trying to move the value box on one specific gauge and can't work out how to do that. Is there an option that I can use to change the value box position on the gauge?

Mikhus commented 7 years ago

Nope, you can't do that with any option. The only way for the moment is to draw your own custom value box. To do that you have to inject into drawing process using appropriate events. Read some info here: https://canvas-gauges.com/documentation/user-guide/scripting-api#injecting-into-gauge-drawing-workflow

And take a look at this example for more info (there is real drawings implementation):

https://github.com/Mikhus/canvas-gauges/blob/v2.1.3/examples/custom-drawings.html

Of course it means you'll need a bit deeper gauge implementation understanding. For that take a look at the source code itself. it should be pretty clear to read and understand, I hope.

All kind regards, Mike