corpglory-dev 6 лет назад
Родитель
Сommit
17c4b7096e
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      packages/grafana-ui/src/components/Piechart/Piechart.tsx

+ 4 - 4
packages/grafana-ui/src/components/Piechart/Piechart.tsx

@@ -4,10 +4,9 @@ import * as d3 from 'd3';
 import { GrafanaThemeType } from '../../types';
 import { GrafanaThemeType } from '../../types';
 import { Themeable } from '../../index';
 import { Themeable } from '../../index';
 
 
-
 export enum PiechartType {
 export enum PiechartType {
   PIE = 'pie',
   PIE = 'pie',
-  DONUT = 'donut'
+  DONUT = 'donut',
 }
 }
 
 
 export interface PiechartDataPoint {
 export interface PiechartDataPoint {
@@ -55,7 +54,7 @@ export class Piechart extends PureComponent<Props> {
     const height = this.canvasElement.height;
     const height = this.canvasElement.height;
     const radius = Math.min(width, height) / 2;
     const radius = Math.min(width, height) / 2;
 
 
-    const innerRadius = pieType === PiechartType.PIE? 0: radius;
+    const innerRadius = pieType === PiechartType.PIE ? 0 : radius;
 
 
     const context = this.canvasElement.getContext('2d');
     const context = this.canvasElement.getContext('2d');
     context.translate(width / 2, height / 2);
     context.translate(width / 2, height / 2);
@@ -64,7 +63,8 @@ export class Piechart extends PureComponent<Props> {
     const pie = d3.pie();
     const pie = d3.pie();
 
 
     const arcs = pie(data);
     const arcs = pie(data);
-    const arc = d3.arc()
+    const arc = d3
+      .arc()
       .outerRadius(radius - 10)
       .outerRadius(radius - 10)
       .innerRadius(innerRadius)
       .innerRadius(innerRadius)
       .padAngle(0.03)
       .padAngle(0.03)