Skip to content

Commit

Permalink
Add the Italian version docs for the 3D pie chart
Browse files Browse the repository at this point in the history
  • Loading branch information
xuri committed Aug 22, 2024
1 parent ef29e96 commit 47ec7ac
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions it/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
* [Grafico a linee](chart/line.md)
* [Grafico a linee 3D](chart/line3D.md)
* [Grafico a torta](chart/pie.md)
* [Grafico a torta 3D](chart/pie3D.md)
* [Immagine](image.md)
* [Aggiungi immagine](image.md#AddPicture)
* [Ottieni immagine](image.md#GetPicture)
Expand Down
71 changes: 71 additions & 0 deletions it/chart/pie3D.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Grafico a torta 3D {#pie3D}

Ad esempio, aggiungi un grafico a torta 3D come questo:

<p align="center"><img width="770" src="../images/3d_pie_chart.png" alt="crea un grafico a torta 3D con Excelize utilizzando Go"></p>

```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{}{
{"Apple", "Orange", "Pear"},
{2, 3, 3},
} {
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.Pie3D,
Series: []excelize.ChartSeries{
{
Name: "Amount",
Categories: "Foglio1!$A$1:$C$1",
Values: "Foglio1!$A$2:$C$2",
},
},
Format: excelize.GraphicOptions{
OffsetX: 15,
OffsetY: 10,
},
Title: []excelize.RichTextRun{
{
Text: "Grafico a torta 3D",
},
},
PlotArea: excelize.ChartPlotArea{
ShowPercent: true,
},
}); err != nil {
fmt.Println(err)
return
}
// Salva cartella di lavoro
if err := f.SaveAs("Cartel1.xlsx"); err != nil {
fmt.Println(err)
}
}
```

0 comments on commit 47ec7ac

Please sign in to comment.