| 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 | graph := chart.Chart{ |
| 13 | Series: []chart.Series{ |
| 14 | chart.ContinuousSeries{ |
| 15 | XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0}, |
| 16 | YValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0}, |
| 17 | }, |
| 18 | }, |
| 19 | } |
| 20 | f, _ := os.Create("output.png") |
| 21 | defer f.Close() |
| 22 | graph.Render(chart.PNG, f) |
| 23 | } |