From 7ee29db038172f613a41ebd4cdb756b23996bf3b Mon Sep 17 00:00:00 2001 From: ooba Date: Mon, 25 Feb 2019 19:03:17 +0900 Subject: [PATCH 1/2] Fixed first value not display bug (#3857 , #3848) --- .../Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift index 9ae8651a22..9acff1f027 100644 --- a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift +++ b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift @@ -111,8 +111,8 @@ extension BarLineScatterCandleBubbleRenderer.XBounds: Sequence { } public mutating func next() -> Int? { - guard value < bounds.max else { return nil } - value += 1 + guard value < bounds.max + 1 else { return nil } + defer { value += 1 } return value } } From 2e808efa2b16da229fa7f1aec4394d92b9194dd3 Mon Sep 17 00:00:00 2001 From: ooba Date: Tue, 26 Feb 2019 11:12:27 +0900 Subject: [PATCH 2/2] Fix `<=` instead of `+ 1` --- .../Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift index 9acff1f027..4544a0aab4 100644 --- a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift +++ b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift @@ -111,7 +111,7 @@ extension BarLineScatterCandleBubbleRenderer.XBounds: Sequence { } public mutating func next() -> Int? { - guard value < bounds.max + 1 else { return nil } + guard value <= bounds.max else { return nil } defer { value += 1 } return value }