summaryrefslogtreecommitdiff
path: root/drawing.go
diff options
context:
space:
mode:
authorlongphee <88870324+longphee@users.noreply.github.com>2022-03-09 12:34:48 +0800
committerGitHub <noreply@github.com>2022-03-09 12:34:48 +0800
commit74b1a998d6018785878ac43b4a4bdcb906766a40 (patch)
tree61db43ffd8cf0580922a3fc7e77ed1a23d6d0776 /drawing.go
parent56aa6b82637b3210be470a8ebac1fdec2b2a6a30 (diff)
This closes #1172, support set hole size for doughnut (#1173)
Diffstat (limited to 'drawing.go')
-rw-r--r--drawing.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/drawing.go b/drawing.go
index 5582bb4..3af789f 100644
--- a/drawing.go
+++ b/drawing.go
@@ -513,13 +513,18 @@ func (f *File) drawBaseChart(formatSet *formatChart) *cPlotArea {
// drawDoughnutChart provides a function to draw the c:plotArea element for
// doughnut chart by given format sets.
func (f *File) drawDoughnutChart(formatSet *formatChart) *cPlotArea {
+ holeSize := 75
+ if formatSet.HoleSize > 0 && formatSet.HoleSize <= 90{
+ holeSize = formatSet.HoleSize
+ }
+
return &cPlotArea{
DoughnutChart: &cCharts{
VaryColors: &attrValBool{
Val: boolPtr(formatSet.VaryColors),
},
Ser: f.drawChartSeries(formatSet),
- HoleSize: &attrValInt{Val: intPtr(75)},
+ HoleSize: &attrValInt{Val: intPtr(holeSize)},
},
}
}