29 lines
499 B
Go
29 lines
499 B
Go
package main
|
|
|
|
//go:generate go run main.go
|
|
|
|
import (
|
|
"os"
|
|
|
|
"git.smarteching.com/zeni/go-chart"
|
|
)
|
|
|
|
func main() {
|
|
pie := chart.PieChart{
|
|
Width: 512,
|
|
Height: 512,
|
|
Values: []chart.Value{
|
|
{Value: 5, Label: "Blues"},
|
|
{Value: 5, Label: "Greens"},
|
|
{Value: 4, Label: "Grays"},
|
|
{Value: 4, Label: "Oranges"},
|
|
{Value: 3, Label: "Deep Blues"},
|
|
{Value: 3, Label: "??"},
|
|
{Value: 1, Label: "!!"},
|
|
},
|
|
}
|
|
|
|
f, _ := os.Create("output.png")
|
|
defer f.Close()
|
|
pie.Render(chart.PNG, f)
|
|
}
|