Update DonutChart.js
Code quality fixes
This commit is contained in:
parent
8d00770207
commit
3e6d7cebf8
@ -32,7 +32,10 @@ export default class DonutChart extends AggregationChart {
|
|||||||
calc() {
|
calc() {
|
||||||
super.calc();
|
super.calc();
|
||||||
let s = this.state;
|
let s = this.state;
|
||||||
this.radius = (this.height > this.width ? this.center.x - (this.strokeWidth / 2) : this.center.y - (this.strokeWidth / 2));
|
this.radius =
|
||||||
|
this.height > this.width
|
||||||
|
? this.center.x - this.strokeWidth / 2
|
||||||
|
: this.center.y - this.strokeWidth / 2;
|
||||||
|
|
||||||
const { radius, clockWise } = this;
|
const { radius, clockWise } = this;
|
||||||
|
|
||||||
@ -101,7 +104,7 @@ export default class DonutChart extends AggregationChart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
calTranslateByAngle(property){
|
calTranslateByAngle(property){
|
||||||
const{radius,hoverRadio} = this;
|
const{ radius, hoverRadio } = this;
|
||||||
const position = getPositionByAngle(property.startAngle+(property.angle / 2),radius);
|
const position = getPositionByAngle(property.startAngle+(property.angle / 2),radius);
|
||||||
return `translate3d(${(position.x) * hoverRadio}px,${(position.y) * hoverRadio}px,0)`;
|
return `translate3d(${(position.x) * hoverRadio}px,${(position.y) * hoverRadio}px,0)`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user