-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
…sion and Sequence Sequence conformance simplifies for-in loops Looking forward to when data types conforming to Collection, RangeExpression conformance by XBounds allows for slicing of the collections further simplifying algorithms on data/datasets.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,7 +214,7 @@ open class LineChartRenderer: LineRadarRenderer | |
// let the spline start | ||
cubicPath.move(to: CGPoint(x: CGFloat(cur.x), y: CGFloat(cur.y * phaseY)), transform: valueToPixelMatrix) | ||
|
||
for j in stride(from: (_xBounds.min + 1), through: _xBounds.range + _xBounds.min, by: 1) | ||
for j in _xBounds.dropFirst() | ||
{ | ||
prev = cur | ||
cur = dataSet.entryForIndex(j) | ||
|
@@ -325,7 +325,7 @@ open class LineChartRenderer: LineRadarRenderer | |
_lineSegments = [CGPoint](repeating: CGPoint(), count: pointsPerEntryPair) | ||
} | ||
|
||
for j in stride(from: _xBounds.min, through: _xBounds.range + _xBounds.min, by: 1) | ||
for j in _xBounds | ||
This comment has been minimized.
Sorry, something went wrong.
liuxuan30
Member
|
||
{ | ||
var e: ChartDataEntry! = dataSet.entryForIndex(j) | ||
|
||
|
@@ -391,7 +391,7 @@ open class LineChartRenderer: LineRadarRenderer | |
context.beginPath() | ||
var firstPoint = true | ||
|
||
for x in stride(from: _xBounds.min, through: _xBounds.range + _xBounds.min, by: 1) | ||
for x in _xBounds | ||
{ | ||
e1 = dataSet.entryForIndex(x == 0 ? 0 : (x - 1)) | ||
e2 = dataSet.entryForIndex(x) | ||
|
@@ -544,7 +544,7 @@ open class LineChartRenderer: LineRadarRenderer | |
|
||
_xBounds.set(chart: dataProvider, dataSet: dataSet, animator: animator) | ||
|
||
for j in stride(from: _xBounds.min, through: min(_xBounds.min + _xBounds.range, _xBounds.max), by: 1) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
for j in _xBounds | ||
{ | ||
guard let e = dataSet.entryForIndex(j) else { break } | ||
|
||
|
@@ -649,7 +649,7 @@ open class LineChartRenderer: LineRadarRenderer | |
(dataSet.circleHoleColor == nil || | ||
dataSet.circleHoleColor == NSUIColor.clear) | ||
|
||
for j in stride(from: _xBounds.min, through: _xBounds.range + _xBounds.min, by: 1) | ||
for j in _xBounds | ||
{ | ||
guard let e = dataSet.entryForIndex(j) else { break } | ||
|
||
|
1 comment
on commit 2a1ecb4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jjatie I'm trying to fix line chart failure of drawing the first circle, it seems
for j in Xbounds()
j is getting1
even bounds.min is0
. Is this a bug that we should return the current value and then+1
?