fix: donut chart, single data point bug
This commit is contained in:
parent
ed8f97efd5
commit
fa559cc8bd
@ -25,6 +25,12 @@ export default class DonutChart extends PieChart {
|
|||||||
: this.center.y - this.strokeWidth / 2;
|
: this.center.y - this.strokeWidth / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetHover(path, color) {
|
||||||
|
transform(path,'translate3d(0,0,0)');
|
||||||
|
this.tip.hideTip();
|
||||||
|
path.style.stroke = color;
|
||||||
|
}
|
||||||
|
|
||||||
setupComponents() {
|
setupComponents() {
|
||||||
let s = this.state;
|
let s = this.state;
|
||||||
|
|
||||||
|
|||||||
@ -131,11 +131,15 @@ export default class PieChart extends AggregationChart {
|
|||||||
this.tip.setValues(x, y, { name: title, value: percent + "%" });
|
this.tip.setValues(x, y, { name: title, value: percent + "%" });
|
||||||
this.tip.showTip();
|
this.tip.showTip();
|
||||||
} else {
|
} else {
|
||||||
|
this.resetHover(path, color)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resetHover(path, color) {
|
||||||
transform(path, 'translate3d(0,0,0)');
|
transform(path, 'translate3d(0,0,0)');
|
||||||
this.tip.hideTip();
|
this.tip.hideTip();
|
||||||
path.style.fill = color;
|
path.style.fill = color;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bindTooltip() {
|
bindTooltip() {
|
||||||
this.container.addEventListener('mousemove', this.mouseMove);
|
this.container.addEventListener('mousemove', this.mouseMove);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user