example tweak.
This commit is contained in:
parent
7776c351a8
commit
3ea3c9ac10
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/wcharczuk/go-chart"
|
"github.com/wcharczuk/go-chart"
|
||||||
|
@ -19,6 +20,12 @@ func drawChart(res http.ResponseWriter, req *http.Request) {
|
||||||
Style: chart.Style{
|
Style: chart.Style{
|
||||||
Show: true, //enables / displays the x-axis
|
Show: true, //enables / displays the x-axis
|
||||||
},
|
},
|
||||||
|
TickPosition: chart.TickPositionBetweenTicks,
|
||||||
|
ValueFormatter: func(v interface{}) string {
|
||||||
|
typed := v.(float64)
|
||||||
|
typedDate := chart.Time.FromFloat64(typed)
|
||||||
|
return fmt.Sprintf("%d-%d\n%d", typedDate.Month(), typedDate.Day(), typedDate.Year())
|
||||||
|
},
|
||||||
},
|
},
|
||||||
YAxis: chart.YAxis{
|
YAxis: chart.YAxis{
|
||||||
Style: chart.Style{
|
Style: chart.Style{
|
||||||
|
|
Loading…
Reference in a new issue