better default handling around final value labels.

This commit is contained in:
Will Charczuk 2016-07-07 19:11:30 -07:00
parent b10ead7cc1
commit 5c8836f9bd
4 changed files with 115 additions and 80 deletions

View file

@ -17,31 +17,34 @@ func main() {
rc.Response.Header().Set("Content-Type", "image/png")
now := time.Now()
c := chart.Chart{
Title: "Stocks Bruh.",
Title: "A Test Chart",
TitleStyle: chart.Style{
Show: true,
},
Width: 1024,
Height: 400,
Canvas: chart.Style{
Padding: chart.Box{
Right: 40,
Bottom: 40,
},
},
Width: 800,
Height: 380,
Axes: chart.Style{
Show: true,
StrokeWidth: 1.0,
},
YRange: chart.Range{
Min: 0.0,
Max: 7.0,
},
FinalValueLabel: chart.Style{
Show: true,
},
Series: []chart.Series{
chart.TimeSeries{
Name: "goog",
Name: "a",
XValues: []time.Time{now.AddDate(0, 0, -4), now.AddDate(0, 0, -3), now.AddDate(0, 0, -2), now.AddDate(0, 0, -1)},
YValues: []float64{2.5, 5.0, 2.0, 3.0},
},
chart.TimeSeries{
Name: "b",
XValues: []time.Time{now.AddDate(0, 0, -4), now.AddDate(0, 0, -3), now.AddDate(0, 0, -2), now.AddDate(0, 0, -1)},
YValues: []float64{6.0, 5.0, 4.0, 1.0},
},
},
}