From 881b72e33ff5b03d281faabdc4f554bcea4eb307 Mon Sep 17 00:00:00 2001 From: shiwangwang Date: Sat, 28 Jul 2018 06:08:32 +0800 Subject: [PATCH] update barRect.size.height calculation when bottom equals top, offset is not necessarily --- Source/Charts/Renderers/BarChartRenderer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Charts/Renderers/BarChartRenderer.swift b/Source/Charts/Renderers/BarChartRenderer.swift index 9427d5e39e..301fa8f30d 100644 --- a/Source/Charts/Renderers/BarChartRenderer.swift +++ b/Source/Charts/Renderers/BarChartRenderer.swift @@ -159,7 +159,7 @@ open class BarChartRenderer: BarLineScatterCandleBubbleRenderer barRect.origin.x = left barRect.size.width = right - left barRect.origin.y = top - barRect.size.height = bottom - top + offset + barRect.size.height = bottom == top ? 0 : bottom - top + offset buffer.rects[bufferIndex] = barRect bufferIndex += 1