Skip to content

Commit

Permalink
Make sure we render the last y Label on LineCharts (Fixes ChartsOrg#1585
Browse files Browse the repository at this point in the history
)

The wrong stride termination was causing us to not render the last text value.
Verified the issue in the `ChartsDemo` example, but have not looked closely
at other chart types.
  • Loading branch information
ryanschneider committed Sep 30, 2016
1 parent 61d10ba commit 7921df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Charts/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ open class LineChartRenderer: LineRadarRenderer

_xBounds.set(chart: dataProvider, dataSet: dataSet, animator: animator)

for j in stride(from: _xBounds.min, to: Int(ceil(Double(_xBounds.max - _xBounds.min) * phaseX + Double(_xBounds.min))), by: 1)
for j in stride(from: _xBounds.min, through: Int(ceil(Double(_xBounds.max - _xBounds.min) * phaseX + Double(_xBounds.min))), by: 1)
{
guard let e = dataSet.entryForIndex(j) else { break }

Expand Down

0 comments on commit 7921df4

Please sign in to comment.