From 6e8b4483bcb779fd6334d8bc606c42e01d4b122d Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 27 Jun 2024 21:13:21 +0800 Subject: [PATCH] Add the Italian version docs for the 3D 100% stacked bar chart - Update GitHub Action tool chain version --- .github/workflows/markdown.yml | 2 +- it/SUMMARY.md | 1 + it/chart/bar3DPercentStacked.md | 91 +++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 it/chart/bar3DPercentStacked.md diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 6f450362..b50aea83 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -6,7 +6,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Markdown Linting Action uses: avto-dev/markdown-lint@v1.5.0 diff --git a/it/SUMMARY.md b/it/SUMMARY.md index 0225db6a..95d9b313 100644 --- a/it/SUMMARY.md +++ b/it/SUMMARY.md @@ -122,6 +122,7 @@ * [Grafico a barre in pila 2D al 100%](chart/barPercentStacked.md) * [Grafico a barre raggruppate 3D](chart/bar3DClustered.md) * [Grafico a barre in pila 3D](chart/bar3DStacked.md) + * [3D 100% stacked bar chart](chart/bar3DPercentStacked.md) * [Immagine](image.md) * [Aggiungi immagine](image.md#AddPicture) * [Ottieni immagine](image.md#GetPicture) diff --git a/it/chart/bar3DPercentStacked.md b/it/chart/bar3DPercentStacked.md new file mode 100644 index 00000000..3d58c4e1 --- /dev/null +++ b/it/chart/bar3DPercentStacked.md @@ -0,0 +1,91 @@ +# Grafico a barre in pila 3D al 100% {#bar3DPercentStacked} + +Ad esempio, aggiungi un grafico a barre in pila 3D al 100% come questo: + +

crea un grafico a barre in pila 3D al 100% con Excelize utilizzando Go

+ +```go +package main + +import ( + "fmt" + + "github.com/xuri/excelize/v2" +) + +func main() { + f := excelize.NewFile() + defer func() { + if err := f.Close(); err != nil { + fmt.Println(err) + } + }() + if err := f.SetSheetName("Sheet1", "Foglio1"); err != nil { + fmt.Println(err) + return + } + for idx, row := range [][]interface{}{ + {nil, "Mela", "Arancia", "Pera"}, + {"Piccolo", 2, 3, 3}, + {"Normale", 5, 2, 4}, + {"Grande", 6, 7, 8}, + } { + cell, err := excelize.CoordinatesToCellName(1, idx+1) + if err != nil { + fmt.Println(err) + return + } + if err := f.SetSheetRow("Foglio1", cell, &row); err != nil { + fmt.Println(err) + return + } + } + if err := f.AddChart("Foglio1", "E1", &excelize.Chart{ + Type: excelize.Bar3DPercentStacked, + Series: []excelize.ChartSeries{ + { + Name: "Foglio1!$A$2", + Categories: "Foglio1!$B$1:$D$1", + Values: "Foglio1!$B$2:$D$2", + }, + { + Name: "Foglio1!$A$3", + Categories: "Foglio1!$B$1:$D$1", + Values: "Foglio1!$B$3:$D$3", + }, + { + Name: "Foglio1!$A$4", + Categories: "Foglio1!$B$1:$D$1", + Values: "Foglio1!$B$4:$D$4", + }, + }, + Format: excelize.GraphicOptions{ + OffsetX: 15, + OffsetY: 10, + }, + Legend: excelize.ChartLegend{ + Position: "left", + }, + Title: []excelize.RichTextRun{ + { + Text: "Grafico a barre in pila 3D al 100%", + }, + }, + PlotArea: excelize.ChartPlotArea{ + ShowCatName: false, + ShowLeaderLines: false, + ShowPercent: true, + ShowSerName: true, + ShowVal: true, + }, + ShowBlanksAs: "zero", + }); err != nil { + fmt.Println(err) + return + } + // Salva cartella di lavoro + if err := f.SaveAs("Cartel1.xlsx"); err != nil { + fmt.Println(err) + } +} +```