A simple chart implementation that an be used in fyne applications.
As of now, negative values are not yet implemented. Can be used in plotting to the first quadrant of the cartessian plane.
- Scatter Plot
- Bar Chart
- Pie Chart
- Column Chart
go get github.com/alexiusacademia/fynesimplechart
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 1")
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, "Plot 2")
plot2.ShowLine = true
scatter := fynesimplechart.NewGraphWidget([]fynesimplechart.Plot{*plot, *plot2})
scatter.Resize(fyne.NewSize(400, 300))
w.SetContent(scatter)
w.ShowAndRun()
}
- First Graph
![Screenshot 2024-04-13 at 12 06 17 PM](https://private-user-images.githubusercontent.com/19258246/322174220-8d72061a-0d75-469e-b1fc-3cb6575e2d8f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4NTAyMjMsIm5iZiI6MTcyNDg0OTkyMywicGF0aCI6Ii8xOTI1ODI0Ni8zMjIxNzQyMjAtOGQ3MjA2MWEtMGQ3NS00NjllLWIxZmMtM2NiNjU3NWUyZDhmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDEyNTg0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTliNDc1NWExMjBiMzc4YjQ3MWMzYTJkNTk5NDY4NzM1YzFhMDBmNWUyOWJjM2MzNTM1ZTJmNDY3NjA1MWJmZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pGG5ac-B5tv8zbc9y-L9suUa2Lh77KOgJG8HA67EbMs)
- Second Graph for version v0.1.1
![Screenshot 2024-04-13 at 1 33 47 PM](https://private-user-images.githubusercontent.com/19258246/322180832-202443df-f2a5-4d12-87d6-c51e8abcaa08.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4NTAyMjMsIm5iZiI6MTcyNDg0OTkyMywicGF0aCI6Ii8xOTI1ODI0Ni8zMjIxODA4MzItMjAyNDQzZGYtZjJhNS00ZDEyLTg3ZDYtYzUxZThhYmNhYTA4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDEyNTg0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmN2Q5MGFkZDdiMWJlOGJmZDk3YjczODUxNTlmNzE0NTU4MWVhMGE3NmQ3ZmVlNDk4ZWQxZjU0OTBkZWU4NjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vf14Tu76TKOVeLLAxuhmYsk3apmIDvV_HNRyBkLGsyg)
- Graph preview for version v0.1.2
![Screenshot 2024-04-13 at 1 57 41 PM](https://private-user-images.githubusercontent.com/19258246/322181783-e12d0d05-d7a0-4505-9c00-c605309c2049.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4NTAyMjMsIm5iZiI6MTcyNDg0OTkyMywicGF0aCI6Ii8xOTI1ODI0Ni8zMjIxODE3ODMtZTEyZDBkMDUtZDdhMC00NTA1LTljMDAtYzYwNTMwOWMyMDQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDEyNTg0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFlNmQ3NmRlOTAzNDAxMzE0ODFjZDY0MmYxYjYzNDRjYTYxMDYzYzU5OGI0NDljMDNjMmI4NGEwZjM5OTYxNWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.opJGDXDJShHk8qhPxZKmQ4XbAJdTiqtsBgSVB6UBGw0)