fixing fit issues on the xaxis labels for stacked bar.
This commit is contained in:
parent
9b4307e186
commit
9c96af2a22
6 changed files with 42 additions and 12 deletions
8
tick.go
8
tick.go
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue