We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line 243 of chartjs-gauge.js measures text height like this:
var textHeight = ctx.measureText('M').width;
This works fine for some fonts, but not so much for other (f.e. Google) fonts. A better method is:
var textHeight = Math.max(ctx.measureText('m').width, ctx.measureText('\uFF37').width);
Now you need to change the default padding to:
padding: { top: 5, right: 5, bottom: 10, left: 5 }
In my tests (I tested with a LOT of Google fonts), these small changes result in a much better design for the needle-value-box.
The text was updated successfully, but these errors were encountered:
#4 TextHeight calculation can be improved
4c78019
Version 0.1.2
Thanks! Try version 0.1.2
Sorry, something went wrong.
Perfect, looks much better. Thank you!
No branches or pull requests
Line 243 of chartjs-gauge.js measures text height like this:
This works fine for some fonts, but not so much for other (f.e. Google) fonts. A better method is:
Now you need to change the default padding to:
In my tests (I tested with a LOT of Google fonts), these small changes result in a much better design for the needle-value-box.
The text was updated successfully, but these errors were encountered: