diff --git a/_examples/twoaxis/main.go b/_examples/twoaxis/main.go index 7656e2c..6c87a3f 100644 --- a/_examples/twoaxis/main.go +++ b/_examples/twoaxis/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "net/http" "github.com/wcharczuk/go-chart" @@ -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{