Преглед изворни кода

Update DonutChart.js

Code quality fixes
tags/1.2.0
Shivam Mishra пре 6 година
committed by GitHub
родитељ
комит
3e6d7cebf8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 измењених фајлова са 5 додато и 2 уклоњено
  1. +5
    -2
      src/js/charts/DonutChart.js

+ 5
- 2
src/js/charts/DonutChart.js Прегледај датотеку

@@ -32,7 +32,10 @@ export default class DonutChart extends AggregationChart {
calc() {
super.calc();
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;

@@ -101,7 +104,7 @@ export default class DonutChart extends AggregationChart {
}

calTranslateByAngle(property){
const{radius,hoverRadio} = this;
const{ radius, hoverRadio } = this;
const position = getPositionByAngle(property.startAngle+(property.angle / 2),radius);
return `translate3d(${(position.x) * hoverRadio}px,${(position.y) * hoverRadio}px,0)`;
}


Loading…
Откажи
Сачувај