From 8ce82bfc6e17251424ac16686374ee0d8997b9cf Mon Sep 17 00:00:00 2001 From: veasion Date: Fri, 9 Aug 2024 15:38:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A5=BC=E5=9B=BE=E8=B5=B7?= =?UTF-8?q?=E5=A7=8B=E8=A7=92=E5=BA=A6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/chart.js | 3 +++ static/esm-js/chart.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/static/chart.js b/static/chart.js index 880b9d4..b3a2341 100644 --- a/static/chart.js +++ b/static/chart.js @@ -317,6 +317,9 @@ async function drawPieChart(title, chartData, legend, anchor, canvas, ctx) { ctx.rotate(-90 * Math.PI / 180) ctx.translate(-x - centerX, -y - centerY) let startAngle = 0 + if (extInfo.startAngle) { + startAngle = extInfo.startAngle * (Math.PI / 180) + } for (let i = 0; i < values.length; i++) { let property = dataPoints[i].property ctx.fillStyle = await toCtxPaint(ctx, property.fillStyle, property.anchor || anchor) diff --git a/static/esm-js/chart.js b/static/esm-js/chart.js index 2f66e01..2e82f97 100644 --- a/static/esm-js/chart.js +++ b/static/esm-js/chart.js @@ -317,6 +317,9 @@ async function drawPieChart(title, chartData, legend, anchor, canvas, ctx) { ctx.rotate(-90 * Math.PI / 180) ctx.translate(-x - centerX, -y - centerY) let startAngle = 0 + if (extInfo.startAngle) { + startAngle = extInfo.startAngle * (Math.PI / 180) + } for (let i = 0; i < values.length; i++) { let property = dataPoints[i].property ctx.fillStyle = await toCtxPaint(ctx, property.fillStyle, property.anchor || anchor)