switching to generators
This commit is contained in:
parent
2d5aeaf824
commit
45fad0cfb8
94 changed files with 402 additions and 691 deletions
23
examples/basic/main.go
Normal file
23
examples/basic/main.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package main
|
||||
|
||||
//go:generate go run main.go
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/wcharczuk/go-chart"
|
||||
)
|
||||
|
||||
func main() {
|
||||
graph := chart.Chart{
|
||||
Series: []chart.Series{
|
||||
chart.ContinuousSeries{
|
||||
XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
|
||||
YValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
|
||||
},
|
||||
},
|
||||
}
|
||||
f, _ := os.Create("output.png")
|
||||
defer f.Close()
|
||||
graph.Render(chart.PNG, f)
|
||||
}
|
||||
BIN
examples/basic/output.png
Normal file
BIN
examples/basic/output.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Loading…
Add table
Add a link
Reference in a new issue