Skip to content

Commit

Permalink
修复饼图起始角度bug
Browse files Browse the repository at this point in the history
  • Loading branch information
veasion committed Aug 9, 2024
1 parent 5661786 commit 8ce82bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions static/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions static/esm-js/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ce82bf

Please sign in to comment.