-
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
Tooltip's ctx.fillStyle is set to an unexpected value in IE/Edge #1688
Comments
Hmmmm, that's a neat one. I wonder if this happens if you try to do For reference, our forked version is: https://github.com/chartjs/color |
Hmm interesting, at the time it seems that the canvas is trying to do this:
while applying the easeOut function. The values for vm.backgroundColor and vm.opacity are:
It's weird though because I feel like I'm treating the symptoms of another issue. In any case I'll take a look at that color.js file later this afternoon to see if there are any leads. Here is a dump of the full vm object:
|
Thanks for the extra info, I'll have a look. By chance, which easing function are you using? I logged some data on the actual value being set into vm.opacity == 7.365404947729491e-10
ctx.fillStyle == 'rgba(0, 0, 0, 7.365404947729491e-10)' I'm guessing this an implementation issue inside the IE/Edge core. I think if we round the opacity to 0 once it is below a certain value it would work . The reason for the colour of the background jumping to the colour of the fill is that this is the last style set into the canvas. I went to the canvas 2D context spec (http://www.w3.org/TR/2dcontext/#fill-and-stroke-styles) but there aren't any limits specified for the alpha other than ]
|
I'm using the defaults at the moment. In my repo it's set at Thanks for taking the time to gather more info. |
No prob, I'll try and create a PR for this tomorrow |
Sorry I've been on holiday. I'll give this a spin today. Thanks for looking into this. |
It looks like that fixed it! Yay! It looks like some changes I picked up broke resizing so I'll need to investigate that. Closing for now. Cheers. |
Great that it's fixed. Hopefully nothing is too borked with the resizing. I don't recall playing with it recently. |
This is a weird one that I don't expect a lot of people to run into but wanted to bring it up to the community. It seems to only repro in Edge and IE (haven't checked Safari).
In this bit of code:
While the tooltip is fading out, even though this line has set ctx.fillStyle to the appropriate fade out color:
ctx.fillStyle sometimes is set to something completely off.
For example, in my case
vm.backgroundColor
was supposed to bergba(0,0,0,0)
but ended up being#e74c3c
instead. (Wot?) Even when I drop a breakpoint when the value is off and execute the line before (using VS immediate window) I get the right value, it's just what's set in ctx.fillStyle is still completely off.It ends up with a nasty flicker effect. The really weird part is that it happens inconsistently. You have to mouse out really quickly for it to show up. My fix is:
For some more context,
#e74c3c
is the value of the background color I use for some of the points. I am dynamically changing the background of the point based on the value of the point itself which I do through thehelpers.extend(
method.#e74c3c
is the last value I've used for the points. The consistent part of this bug is that the flicker color seems to be the last value I use to dynamically color the points.The text was updated successfully, but these errors were encountered: