example tweaks.
This commit is contained in:
parent
7885ca4d69
commit
3735edb5be
1 changed files with 12 additions and 15 deletions
|
@ -26,18 +26,13 @@ func readData() ([]time.Time, []float64) {
|
|||
}
|
||||
|
||||
func releases() []chart.GridLine {
|
||||
lineStyle := chart.Style{
|
||||
Show: true,
|
||||
StrokeColor: chart.ColorAlternateGray,
|
||||
StrokeWidth: 1.0,
|
||||
}
|
||||
return []chart.GridLine{
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 1, 9, 30, 0, 0, time.UTC)), IsVertical: true, Style: lineStyle},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 2, 9, 30, 0, 0, time.UTC)), IsVertical: true, Style: lineStyle},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 3, 9, 30, 0, 0, time.UTC)), IsVertical: true, Style: lineStyle},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 4, 9, 30, 0, 0, time.UTC)), IsVertical: true, Style: lineStyle},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 5, 9, 30, 0, 0, time.UTC)), IsVertical: true, Style: lineStyle},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 6, 9, 30, 0, 0, time.UTC)), IsVertical: true, Style: lineStyle},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 1, 9, 30, 0, 0, time.UTC))},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 2, 9, 30, 0, 0, time.UTC))},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 3, 9, 30, 0, 0, time.UTC))},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 4, 9, 30, 0, 0, time.UTC))},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 5, 9, 30, 0, 0, time.UTC))},
|
||||
{Value: chart.TimeToFloat64(time.Date(2016, 8, 6, 9, 30, 0, 0, time.UTC))},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,15 +98,17 @@ func drawChart(res http.ResponseWriter, req *http.Request) {
|
|||
XAxis: chart.XAxis{
|
||||
Style: chart.StyleShow(),
|
||||
ValueFormatter: chart.TimeHourValueFormatter,
|
||||
GridMajorStyle: chart.StyleShow(),
|
||||
GridLines: releases(),
|
||||
GridMajorStyle: chart.Style{
|
||||
Show: true,
|
||||
StrokeColor: chart.ColorAlternateGray,
|
||||
StrokeWidth: 1.0,
|
||||
},
|
||||
GridLines: releases(),
|
||||
},
|
||||
Series: []chart.Series{
|
||||
mainSeries,
|
||||
minSeries,
|
||||
maxSeries,
|
||||
chart.LastValueAnnotation(minSeries),
|
||||
chart.LastValueAnnotation(maxSeries),
|
||||
linreg,
|
||||
chart.LastValueAnnotation(linreg),
|
||||
sma,
|
||||
|
|
Loading…
Reference in a new issue