Debian Codegraph @

examples/donut_chart/main.go

raw symbols SCIP
1 package main
2
3 //go:generate go run main.go
4
5 import (
6 "os"
7
8 "github.com/wcharczuk/go-chart/v2"
9 )
10
11 func main() {
12 pie := chart.DonutChart{
13 Width: 512,
14 Height: 512,
15 Values: []chart.Value{
16 {Value: 5, Label: "Blue"},
17 {Value: 5, Label: "Green"},
18 {Value: 4, Label: "Gray"},
19 {Value: 4, Label: "Orange"},
20 {Value: 3, Label: "Deep Blue"},
21 {Value: 3, Label: "test"},
22 },
23 }
24
25 f, _ := os.Create("output.png")
26 defer f.Close()
27 pie.Render(chart.PNG, f)
28 }