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
53
examples/stacked_bar/main.go
Normal file
53
examples/stacked_bar/main.go
Normal file
|
@ -0,0 +1,53 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
sbc := chart.StackedBarChart{
|
||||
Title: "Test Stacked Bar Chart",
|
||||
Background: chart.Style{
|
||||
Padding: chart.Box{
|
||||
Top: 40,
|
||||
},
|
||||
},
|
||||
Height: 512,
|
||||
Bars: []chart.StackedBar{
|
||||
{
|
||||
Name: "This is a very long string to test word break wrapping.",
|
||||
Values: []chart.Value{
|
||||
{Value: 5, Label: "Blue"},
|
||||
{Value: 5, Label: "Green"},
|
||||
{Value: 4, Label: "Gray"},
|
||||
{Value: 3, Label: "Orange"},
|
||||
{Value: 3, Label: "Test"},
|
||||
{Value: 2, Label: "??"},
|
||||
{Value: 1, Label: "!!"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Test",
|
||||
Values: []chart.Value{
|
||||
{Value: 10, Label: "Blue"},
|
||||
{Value: 5, Label: "Green"},
|
||||
{Value: 1, Label: "Gray"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Test 2",
|
||||
Values: []chart.Value{
|
||||
{Value: 10, Label: "Blue"},
|
||||
{Value: 6, Label: "Green"},
|
||||
{Value: 4, Label: "Gray"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
f, _ := os.Create("output.png")
|
||||
defer f.Close()
|
||||
sbc.Render(chart.PNG, f)
|
||||
}
|
BIN
examples/stacked_bar/output.png
Normal file
BIN
examples/stacked_bar/output.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Loading…
Add table
Add a link
Reference in a new issue