From 7a3d6a6915c0118fa243801032ab2e7f00441aed Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Sun, 5 Mar 2017 23:21:39 -0800 Subject: [PATCH] also do this for the secondary axis --- chart.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/chart.go b/chart.go index ed91b8d..d944882 100644 --- a/chart.go +++ b/chart.go @@ -283,11 +283,13 @@ func (c Chart) getRanges() (xrange, yrange, yrangeAlt Range) { yrangeAlt.SetMin(minya) yrangeAlt.SetMax(maxya) - delta := yrangeAlt.GetDelta() - roundTo := Math.GetRoundToForDelta(delta) - rmin, rmax := Math.RoundDown(yrangeAlt.GetMin(), roundTo), Math.RoundUp(yrangeAlt.GetMax(), roundTo) - yrangeAlt.SetMin(rmin) - yrangeAlt.SetMax(rmax) + if c.YAxisSecondary.Style.Show { + delta := yrangeAlt.GetDelta() + roundTo := Math.GetRoundToForDelta(delta) + rmin, rmax := Math.RoundDown(yrangeAlt.GetMin(), roundTo), Math.RoundUp(yrangeAlt.GetMax(), roundTo) + yrangeAlt.SetMin(rmin) + yrangeAlt.SetMax(rmax) + } } return