-
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
Incorrect border highlight in Pie Charts #2381
Comments
@Tutuchan thanks for the report. I think the issue is draw order. The arcs are drawn clockwise so the 2nd arc overlaps one of the edges of the first arc. |
I tried to take a look at this problem but I'm not sure I'm in the right track as I'm not really proficient with JavaScript. I modified the draw function in controller.dougnut.js to be able to take a draw: function(ease, lastIndex) {
var easingDecimal = ease || 1;
helpers.each(this.getMeta().data, function(arc, index) {
arc.transition(easingDecimal).draw();
});
if (lastIndex) this.getMeta().data[lastIndex].draw()
} Then, in core.controller.js, I added a call to the draw function when setting the hover styling: // Built in hover styling
if (this.active.length && this.options.hover.mode) {
switch (this.options.hover.mode) {
case 'single':
this.getDatasetMeta(this.active[0]._datasetIndex).controller.setHoverStyle(this.active[0]);
this.getDatasetMeta(this.active[0]._datasetIndex).controller.draw(0, this.active[0]._index);
break;
... This seems to be more or less working but the hovered edges do not appear on first entering the wedge, only when moving the mouse around and even then not immediately. I don't know how to create a jsbin with this modified version but I forked it there. |
@Tutuchan i think the angles in the doughnut controller need to be updated for the size of the border.
|
@etimberg I had some time to take a look at this and I'm not sure about the angles approach. The overlap between two segments is different on the inner radius and on the outer radius so even if you make it so the borders do not overlap near the outer radius, they will overlap near the inner one. See here for example: |
+1 |
Hi everyone, seem this bug is not fixed yet, any help? |
+1 |
+2 |
Hello,
When creating a pie chart with a hoverBorderColor, not all wedges borders are higlighted on mouseover.
See here: https://output.jsbin.com/jezuce/1
Some borders are black when highlighted while others are not.
The text was updated successfully, but these errors were encountered: