Skip to content

Commit

Permalink
example tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Charczuk committed Feb 3, 2017
1 parent 7776c35 commit 3ea3c9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _examples/twoaxis/main.go
@@ -1,6 +1,7 @@
package main

import (
"fmt"
"net/http"

"github.com/wcharczuk/go-chart"
Expand All @@ -19,6 +20,12 @@ func drawChart(res http.ResponseWriter, req *http.Request) {
Style: chart.Style{
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{
Style: chart.Style{
Expand Down

0 comments on commit 3ea3c9a

Please sign in to comment.