Adding upstream version 2.1.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c8c64afc61
commit
41a2f19f12
220 changed files with 19814 additions and 0 deletions
29
examples/pie_chart/main.go
Normal file
29
examples/pie_chart/main.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package main
|
||||
|
||||
//go:generate go run main.go
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pie := chart.PieChart{
|
||||
Width: 512,
|
||||
Height: 512,
|
||||
Values: []chart.Value{
|
||||
{Value: 5, Label: "Blue"},
|
||||
{Value: 5, Label: "Green"},
|
||||
{Value: 4, Label: "Gray"},
|
||||
{Value: 4, Label: "Orange"},
|
||||
{Value: 3, Label: "Deep Blue"},
|
||||
{Value: 3, Label: "??"},
|
||||
{Value: 1, Label: "!!"},
|
||||
},
|
||||
}
|
||||
|
||||
f, _ := os.Create("output.png")
|
||||
defer f.Close()
|
||||
pie.Render(chart.PNG, f)
|
||||
}
|
BIN
examples/pie_chart/output.png
Normal file
BIN
examples/pie_chart/output.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
17
examples/pie_chart/reg.svg
Normal file
17
examples/pie_chart/reg.svg
Normal file
|
@ -0,0 +1,17 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512">
|
||||
<path d="M 256 256
|
||||
L 507 256
|
||||
A 251 251 225.00 1 1 79 79
|
||||
L 256 256
|
||||
Z" style="stroke-width:5;stroke:rgba(255,255,255,1.0);fill:rgba(106,195,203,1.0)"/>
|
||||
<path d="M 256 256
|
||||
L 79 79
|
||||
A 251 251 90.00 0 1 433 79
|
||||
L 256 256
|
||||
Z" style="stroke-width:5;stroke:rgba(255,255,255,1.0);fill:rgba(42,190,137,1.0)"/>
|
||||
<path d="M 256 256
|
||||
L 433 79
|
||||
A 251 251 45.00 0 1 507 256
|
||||
L 256 256
|
||||
Z" style="stroke-width:5;stroke:rgba(255,255,255,1.0);fill:rgba(110,128,139,1.0)"/>
|
||||
</svg>
|
After Width: | Height: | Size: 565 B |
Loading…
Add table
Add a link
Reference in a new issue