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

Vertical align of canvas content #108

Closed PetroGolovnya closed 5 years ago

PetroGolovnya commented 7 years ago

Good day!

How i can create gauge aligned by bottom of canvas and big font in title?

Like this https://jsfiddle.net/e0y2a5mz/ ? But when i make small data-ticks-width < 50 bottom line of gauge rises up. When i use font in titile with size greater than 36 - title rises up.

PetroGolovnya commented 7 years ago

In file LinearGauge.js add context.textBaseline = 'middle' in function drawLinearTitle(context, options) and title shifted slightly down.