From 60abe34190267036ed3779c17cc2ead7510e2103 Mon Sep 17 00:00:00 2001 From: liuxuan30 Date: Wed, 13 Jan 2016 17:03:24 +0800 Subject: [PATCH] fix code style in ChartYAxisRenderer --- .../Renderers/ChartYAxisRenderer.swift | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Charts/Classes/Renderers/ChartYAxisRenderer.swift b/Charts/Classes/Renderers/ChartYAxisRenderer.swift index d2ee98e4a7..09dc299567 100644 --- a/Charts/Classes/Renderers/ChartYAxisRenderer.swift +++ b/Charts/Classes/Renderers/ChartYAxisRenderer.swift @@ -107,41 +107,41 @@ public class ChartYAxisRenderer: ChartAxisRendererBase { // no forced count - // if the labels should only show min and max - if (_yAxis.isShowOnlyMinMaxEnabled) - { - _yAxis.entries = [yMin, yMax] - } - else - { - let first = ceil(Double(yMin) / interval) * interval - let last = ChartUtils.nextUp(floor(Double(yMax) / interval) * interval) - - var f: Double - var i: Int - var n = 0 - for (f = first; f <= last; f += interval) + // if the labels should only show min and max + if (_yAxis.isShowOnlyMinMaxEnabled) { - ++n + _yAxis.entries = [yMin, yMax] } - - if (_yAxis.entries.count < n) - { - // Ensure stops contains at least numStops elements. - _yAxis.entries = [Double](count: n, repeatedValue: 0.0) - } - else if (_yAxis.entries.count > n) - { - _yAxis.entries.removeRange(n..<_yAxis.entries.count) - } - - for (f = first, i = 0; i < n; f += interval, ++i) + else { - _yAxis.entries[i] = Double(f) + let first = ceil(Double(yMin) / interval) * interval + let last = ChartUtils.nextUp(floor(Double(yMax) / interval) * interval) + + var f: Double + var i: Int + var n = 0 + for (f = first; f <= last; f += interval) + { + ++n + } + + if (_yAxis.entries.count < n) + { + // Ensure stops contains at least numStops elements. + _yAxis.entries = [Double](count: n, repeatedValue: 0.0) + } + else if (_yAxis.entries.count > n) + { + _yAxis.entries.removeRange(n..<_yAxis.entries.count) + } + + for (f = first, i = 0; i < n; f += interval, ++i) + { + _yAxis.entries[i] = Double(f) + } } } } - } /// draws the y-axis labels to the screen public override func renderAxisLabels(context context: CGContext)