Skip to content

Commit

Permalink
Merge pull request #712 from gunterhager/cubic-line-chart-fill
Browse files Browse the repository at this point in the history
Fix for cubic line chart fill when charts that don't start at x-index 0 #711
  • Loading branch information
danielgindi committed Feb 23, 2016
2 parents 6e4bcbc + 2c0c9cc commit 79b5ceb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,11 @@ public class LineChartRenderer: LineRadarChartRenderer

let fillMin = dataSet.fillFormatter?.getFillLinePosition(dataSet: dataSet, dataProvider: dataProvider) ?? 0.0

var pt1 = CGPoint(x: CGFloat(to - 1), y: fillMin)
var pt2 = CGPoint(x: CGFloat(from), y: fillMin)
let xTo = dataSet.entryForIndex(to - 1)?.xIndex ?? 0
let xFrom = dataSet.entryForIndex(from)?.xIndex ?? 0

var pt1 = CGPoint(x: CGFloat(xTo), y: fillMin)
var pt2 = CGPoint(x: CGFloat(xFrom), y: fillMin)
pt1 = CGPointApplyAffineTransform(pt1, matrix)
pt2 = CGPointApplyAffineTransform(pt2, matrix)

Expand Down

0 comments on commit 79b5ceb

Please sign in to comment.