Closed Kerlli closed 1 month ago
Description
Hi, Maintainers
How can I set the Fill color for each part of pie chart ?
Fill
Like:
for idx, row := range [][]interface{}{ {"Apple", "Orange", "Pear"}, {2, 3, 3}, } { cell, err := excelize.CoordinatesToCellName(1, idx+1) if err != nil { fmt.Println(err) return } if err := f.SetSheetRow("Sheet1", cell, &row); err != nil { fmt.Println(err) return } } if err := f.AddChart("Sheet1", "E1", &excelize.Chart{ Type: excelize.Pie, Series: []excelize.ChartSeries{ { Name: "Amount", Categories: "Sheet1!$A$1:$C$1", Values: "Sheet1!$A$2:$C$2", }, }, Title: []excelize.RichTextRun{ { Text: "Fruit Pie Chart", }, }, }); err != nil { fmt.Println(err) return }
I'm wondering about how to set colors for Apple, Orange and Pear
Apple
Orange
Pear
Thanks.
Steps to reproduce the issue:
Describe the results you received:
Each series fill color can only be set by:
excelize.ChartSeries{ Fill: excelize.Fill{ Type: "pattern", Color: []string{"#505050"}, Pattern: 1, }, }
Describe the results you expected:
Output of go version:
go version
v1.22
Excelize version or commit ID:
2.8.1
Environment details (OS, Microsoft Excel™ version, physical, etc.):
Duplicated with #1862.
I closed this issue, and keep #1862 to track this feature request, if you have any questions, please let me know to reopen this anytime.
Description
Hi, Maintainers
How can I set the
Fill
color for each part of pie chart ?Like:
I'm wondering about how to set colors for
Apple
,Orange
andPear
Thanks.
Steps to reproduce the issue:
Describe the results you received:
Each series fill color can only be set by:
Describe the results you expected:
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):