fixing fit issues on the xaxis labels for stacked bar.

This commit is contained in:
Will Charczuk 2016-07-30 09:35:44 -07:00
parent 9b4307e186
commit 9c96af2a22
6 changed files with 42 additions and 12 deletions

View file

@ -32,7 +32,7 @@ func (t Ticks) Less(i, j int) bool {
}
// GenerateContinuousTicksWithStep generates a set of ticks.
func GenerateContinuousTicksWithStep(ra Range, step float64, vf ValueFormatter) []Tick {
func GenerateContinuousTicksWithStep(ra Range, step float64, vf ValueFormatter, includeMax bool) []Tick {
var ticks []Tick
min, max := ra.GetMin(), ra.GetMax()
for cursor := min; cursor <= max; cursor += step {
@ -46,6 +46,12 @@ func GenerateContinuousTicksWithStep(ra Range, step float64, vf ValueFormatter)
return ticks
}
}
if includeMax {
ticks = append(ticks, Tick{
Value: ra.GetMax(),
Label: vf(ra.GetMax()),
})
}
return ticks
}