From 44ba57d97832035237ec832cb6b7582686b6e6c1 Mon Sep 17 00:00:00 2001 From: Anton Filimonov Date: Fri, 9 Nov 2018 16:43:11 +0400 Subject: [PATCH] Fix applying lineCap value for line chart data sets (Fixes #3739) DataSets for line chart have lineCap property which is supposed to be applied to the chart line. But it was applied only if dataSet is drawn in linear/stepped mode. This commit makes lineCap work for any existing mode. --- Source/Charts/Renderers/LineChartRenderer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Charts/Renderers/LineChartRenderer.swift b/Source/Charts/Renderers/LineChartRenderer.swift index 2d8ae7b02c..47c6ea73b9 100644 --- a/Source/Charts/Renderers/LineChartRenderer.swift +++ b/Source/Charts/Renderers/LineChartRenderer.swift @@ -73,6 +73,8 @@ open class LineChartRenderer: LineRadarRenderer context.setLineDash(phase: 0.0, lengths: []) } + context.setLineCap(dataSet.lineCapType) + // if drawing cubic lines is enabled switch dataSet.mode { @@ -313,8 +315,6 @@ open class LineChartRenderer: LineRadarRenderer } context.saveGState() - - context.setLineCap(dataSet.lineCapType) // more than 1 color if dataSet.colors.count > 1