From b585e01a51e4bc04264c74f70377a7e946129881 Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 20 Aug 2024 19:24:05 +0800 Subject: [PATCH] Add the Italian version docs for the 3D line chart --- it/SUMMARY.md | 1 + it/chart/line3D.md | 91 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 it/chart/line3D.md diff --git a/it/SUMMARY.md b/it/SUMMARY.md index ba2eb13c..18d42c51 100644 --- a/it/SUMMARY.md +++ b/it/SUMMARY.md @@ -153,6 +153,7 @@ * [Grafico a colonne in pila a cilindri 3D al 100%](chart/col3DCylinderPercentStacked.md) * [Grafico a ciambella](chart/doughnut.md) * [Grafico a linee](chart/line.md) + * [Grafico a linee 3D](chart/line3D.md) * [Immagine](image.md) * [Aggiungi immagine](image.md#AddPicture) * [Ottieni immagine](image.md#GetPicture) diff --git a/it/chart/line3D.md b/it/chart/line3D.md new file mode 100644 index 00000000..e108aa9d --- /dev/null +++ b/it/chart/line3D.md @@ -0,0 +1,91 @@ +# Grafico a linee 3D {#line3D} + +Ad esempio, aggiungi un grafico a linee 3D come questo: + +

crea un grafico a linee 3D 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.Line3D, + 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: "top", + }, + Title: []excelize.RichTextRun{ + { + Text: "Grafico a linee 3D", + }, + }, + PlotArea: excelize.ChartPlotArea{ + ShowCatName: false, + ShowLeaderLines: false, + ShowPercent: false, + ShowSerName: false, + ShowVal: false, + }, + ShowBlanksAs: "zero", + }); err != nil { + fmt.Println(err) + return + } + // Salva cartella di lavoro + if err := f.SaveAs("Cartel1.xlsx"); err != nil { + fmt.Println(err) + } +} +```