refactor: adjust bar series

This commit is contained in:
vicanso 2021-12-14 23:26:34 +08:00
parent f3009b965f
commit be19cd728a
4 changed files with 56 additions and 17 deletions

View file

@ -79,10 +79,11 @@ func (cs BaseSeries) GetValues(index int) (float64, float64) {
// GetFirstValues gets the first x,y values.
func (cs BaseSeries) GetFirstValues() (float64, float64) {
index := 0
if cs.TickPosition == chart.TickPositionBetweenTicks {
return cs.XValues[1], cs.YValues[1]
index++
}
return cs.XValues[0], cs.YValues[0]
return cs.XValues[index], cs.YValues[index]
}
// GetLastValues gets the last x,y values.