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;
|
||||
}
|
||||
|
||||
resetHover(path, color) {
|
||||
transform(path,'translate3d(0,0,0)');
|
||||
this.tip.hideTip();
|
||||
path.style.stroke = color;
|
||||
}
|
||||
|
||||
setupComponents() {
|
||||
let s = this.state;
|
||||
|
||||
|
||||
@ -131,12 +131,16 @@ export default class PieChart extends AggregationChart {
|
||||
this.tip.setValues(x, y, { name: title, value: percent + "%" });
|
||||
this.tip.showTip();
|
||||
} else {
|
||||
transform(path, 'translate3d(0,0,0)');
|
||||
this.tip.hideTip();
|
||||
path.style.fill = color;
|
||||
this.resetHover(path, color)
|
||||
}
|
||||
}
|
||||
|
||||
resetHover(path, color) {
|
||||
transform(path, 'translate3d(0,0,0)');
|
||||
this.tip.hideTip();
|
||||
path.style.fill = color;
|
||||
}
|
||||
|
||||
bindTooltip() {
|
||||
this.container.addEventListener('mousemove', this.mouseMove);
|
||||
this.container.addEventListener('mouseleave', this.mouseLeave);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user