Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1420 from liuxuan30/Swift-3.0
Browse files Browse the repository at this point in the history
[swift 3.0 specific]fix linear line chart additional line segments wile zooming in
liuxuan30 authored Sep 20, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 2dd22b9 + 394973c commit ab3bb61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
@@ -383,18 +383,18 @@ open class LineChartRenderer: LineRadarChartRenderer

var e1: ChartDataEntry!
var e2: ChartDataEntry!

let count = Int(ceil(CGFloat(maxx - minx) * phaseX + CGFloat(minx)))

if (_lineSegments.count != max((entryCount - 1) * pointsPerEntryPair, pointsPerEntryPair))
if (_lineSegments.count != max((count - minx - 1) * pointsPerEntryPair, pointsPerEntryPair))
{
_lineSegments = [CGPoint](repeating: CGPoint(), count: max((entryCount - 1) * pointsPerEntryPair, pointsPerEntryPair))
_lineSegments = [CGPoint](repeating: CGPoint(), count: max((count - minx - 1) * pointsPerEntryPair, pointsPerEntryPair))
}

e1 = dataSet.entryForIndex(minx)

if e1 != nil
{
let count = Int(ceil(CGFloat(maxx - minx) * phaseX + CGFloat(minx)))

var j = 0
for x in stride(from: (count > 1 ? minx + 1 : minx), to: count, by: 1)
{

0 comments on commit ab3bb61

Please sign in to comment.