fyne-simple-chart
A simple chart implementation that an be used in fyne applications.
Warning
As of now, negative values are not yet implemented. Can be used in plotting to the first quadrant of the cartessian plane.
Features
- Scatter Plot
- Bar Chart
- Pie Chart
- Column Chart
Installation
go get github.com/alexiusacademia/fynesimplechart
Usage
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"github.com/alexiusacademia/fynesimplechart"
)
func main() {
a := app.New()
w := a.NewWindow("Hello")
nodes := []fynesimplechart.Node{
*fynesimplechart.NewNode(1, 1),
*fynesimplechart.NewNode(1, 3),
*fynesimplechart.NewNode(4, 0),
*fynesimplechart.NewNode(5, 2),
}
plot := fynesimplechart.NewPlot(nodes)
plot.ShowLine = true
nodes2 := []fynesimplechart.Node{
*fynesimplechart.NewNode(1.5, 5),
*fynesimplechart.NewNode(5, 4),
*fynesimplechart.NewNode(8, 7),
*fynesimplechart.NewNode(10, 2),
}
plot2 := fynesimplechart.NewPlot(nodes2)
plot2.ShowLine = true
scatter := fynesimplechart.NewGraphWidget([]fynesimplechart.Plot{*plot, *plot2})
scatter.Resize(fyne.NewSize(400, 300))
w.SetContent(scatter)
w.ShowAndRun()
}
-
First Graph
-
Second Graph for version v0.1.1