在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:wcharczuk/go-chart开源软件地址:https://github.com/wcharczuk/go-chart开源编程语言:Go 100.0%开源软件介绍:go-chartPackage Master should now be on the v3.x codebase, which overhauls the api significantly. Per usual, see InstallationTo install > go get -u github.com/wcharczuk/go-chart Most of the components are interchangeable so feel free to crib whatever you want. Output ExamplesSpark Lines: Single axis: Two axis: Other Chart TypesPie Chart: The code for this chart can be found in Stacked Bar: The code for this chart can be found in Code ExamplesActual chart configurations and examples can be found in the UsageEverything starts with the import (
...
"bytes"
...
"github.com/wcharczuk/go-chart" //exposes "chart"
)
graph := chart.Chart{
Series: []chart.Series{
chart.ContinuousSeries{
XValues: []float64{1.0, 2.0, 3.0, 4.0},
YValues: []float64{1.0, 2.0, 3.0, 4.0},
},
},
}
buffer := bytes.NewBuffer([]byte{})
err := graph.Render(chart.PNG, buffer) Explanation of the above: A Here, we have a single series with x range values as float64s, rendered to a PNG. Note; we can pass any type of API OverviewEverything on the The best way to see the api in action is to look at the examples in the Design PhilosophyI wanted to make a charting library that used only native golang, that could be stood up on a server (i.e. it had built in fonts). The goal with the API itself is to have the "zero value be useful", and to require the user to not code more than they absolutely needed. ContributionsContributions are welcome though this library is in a holding pattern for the forseable future. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论