Skip to content

Commit

Permalink
Fix applying lineCap value for line chart data sets (Fixes ChartsOrg#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Anton Filimonov authored and gemedet committed Feb 27, 2019
1 parent 5689a1c commit 3567aa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Charts/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ open class LineChartRenderer: LineRadarRenderer
context.setLineDash(phase: 0.0, lengths: [])
}

context.setLineCap(dataSet.lineCapType)

// if drawing cubic lines is enabled
switch dataSet.mode
{
Expand Down Expand Up @@ -329,8 +331,6 @@ open class LineChartRenderer: LineRadarRenderer
context.saveGState()
defer { context.restoreGState() }

context.setLineCap(dataSet.lineCapType)

// more than 1 color
if dataSet.colors.count > 1, !dataSet.isDrawLineWithGradientEnabled
{
Expand Down

0 comments on commit 3567aa0

Please sign in to comment.