qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
17.62k stars 1.68k forks source link

Different PieChart parts color and legend colors #1907

Closed kekovubicaprod closed 1 month ago

kekovubicaprod commented 1 month ago

Description chart := &excelize.Chart{ Type: excelize.Pie, Series: []excelize.ChartSeries{ { Name: "Amount", Categories: fmt.Sprintf("Sheet1!$%s$%s:$%s$%s", strings.Split(filledCategories[0], ":")[0], strings.Split(filledCategories[0], ":")[1], strings.Split(filledCategories[len(filledCategories)-1], ":")[0], strings.Split(filledCategories[len(filledCategories)-1], ":")[1]), Values: fmt.Sprintf("Sheet1!$%s$%s:$%s$%s", strings.Split(filledCategories[0], ":")[0], strings.Split(filledValues[0], ":")[1], strings.Split(filledValues[len(filledValues)-1], ":")[0], strings.Split(filledValues[len(filledValues)-1], ":")[1]), }, },

        Dimension: excelize.ChartDimension{
            Width:  200,
            Height: 300,
        },
        Legend: excelize.ChartLegend{
            Position:      "bottom",
            ShowLegendKey: false,
        },
        Title: []excelize.RichTextRun{
            {
                Font: nil,
                Text: value[headersDict["Цех"]].(string),
            },
        },

    }

Steps to reproduce the issue: 1. 2. 3.

Describe the results you received:

image image image

Describe the results you expected:

Output of go version:

go version go1.22.3 linux/amd64

Excelize version or commit ID:

v2.8.1

Environment details (OS, Microsoft Excel™ version, physical, etc.): ubuntu 22.04 libre office

xuri commented 1 month ago

Thanks for your issue. Could you show us a complete, standalone example program or reproducible demo? If you open an existing workbook, please provide the file attachment without confidential info.

kekovubicaprod commented 1 month ago

sry my bad