Skip to content

Commit

Permalink
docs: update demo of pie statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Jun 27, 2022
1 parent 086de1e commit 1965390
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/pie/donut/demo/statistics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Pie, measureTextWidth } from '@antv/g2plot';

function renderStatistic(containerWidth, text, style) {
const { width: textWidth, height: textHeight } = measureTextWidth(text, style);
const textWidth = measureTextWidth(text, style);
const textHeight = style.lineHeight || style.fontSize
const R = containerWidth / 2;
// r^2 = (w / 2)^2 + (h - offsetY)^2
let scale = 1;
Expand Down

0 comments on commit 1965390

Please sign in to comment.