-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
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
Hovering over point changes the legend fontStyle when set to 'semibold' #3318
Comments
@elliottregan the issue here is that 'semibold' doesn't seem to be recognized by the canvas and so setting the font silently fails. https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight indicates that setting a font weight of '600' is equivalent to semi-bold but I cannot detect a difference between 600 & 800 (bold). The docs on the canvas rendering context font property https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font just say that it should be a valid CSS font string which we have but the canvas doesn't like it. For reference, the font is set ctx.font = "semibold 20px 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" Maybe we can detect this case after setting by comparing @simonbrunel @zachpanz88 thoughts on this? |
I looked into this more. The problem here is that, the system has no semibold Helvetica Neue font so it's not applied to the canvas rendering context when we set it. I thought about filing a Chrome issue for this, but the behaviour is the same as for the CSS Test case: https://jsfiddle.net/6zqcsph9/ Recommendation: close as not a bug |
Gotchya. That's annoying. If there is no way to detect a missing font weight, maybe a note in ChartJS's docs would be useful.
|
We can definitely do that. |
only three, or four specified fonts family can be applied or others can also be applied |
Demo: http://codepen.io/anon/pen/LRkyor
If you hover over a point, you'll see the legend flash between two different font styles and sizes. If you change line 39 from 'semibold' to 'bold', the flickering stops.
The text was updated successfully, but these errors were encountered: