Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate Chart v3 code in master to swift 2.3 branch #1389

Merged
merged 128 commits into from
Sep 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
0ef4220
update iso-snapshot-test-case to master to have the fix for now
liuxuan30 Jul 1, 2016
c5c442b
Merge pull request #1202 from liuxuan30/fixTravis
liuxuan30 Jul 1, 2016
3197e7a
upgrade carthage to 0.17.1
liuxuan30 Jul 1, 2016
a72a43a
use master commit for iso-snapshot-test-case for now. once the fix is…
liuxuan30 Jul 1, 2016
31e9cff
change Rakefile, comment out tvOS because no FBSnapshotTestCase
liuxuan30 Jul 1, 2016
1b60553
Merge pull request #1203 from liuxuan30/fixTravis
liuxuan30 Jul 1, 2016
7eb5810
Add missing imports for iOS 7 support
VincentSit Jul 1, 2016
3b31396
Update ChartSelectionDetail.swift
VincentSit Jul 1, 2016
098b961
BUGFIX: fix infinite recursive call of getXIndex(_:)
AntiMoron Jul 3, 2016
69998e0
Merge pull request #1205 from VincentSit/patch-1
liuxuan30 Jul 4, 2016
a7155c6
Merge pull request #1213 from AntiMoron/master
liuxuan30 Jul 5, 2016
4d08068
for #1208, seems drawBarShadowEnabled should be false by default
liuxuan30 Jul 6, 2016
3734cc7
1. update ios-snapshot-test-case to 2.1.2
liuxuan30 Jul 14, 2016
2efba1d
Merge pull request #1249 from liuxuan30/fixTravis
liuxuan30 Jul 14, 2016
eadefab
improve descriptions to warn users how to use setVisibleRange APIs
liuxuan30 Jul 13, 2016
d432396
Typo fix
chris-gunawardena Jul 23, 2016
8aab7b1
Merge pull request #1264 from chris-gunawardena/patch-1
pmairoldi Jul 23, 2016
6d91f61
upgrade Realm to 1.0.2
liuxuan30 Jul 25, 2016
d8e60fe
update Realm pod spec to 1.0.2
liuxuan30 Jul 26, 2016
8b7b589
Merge pull request #1270 from liuxuan30/Realm1.0.2
liuxuan30 Jul 26, 2016
6b29503
fix pod spec typo
liuxuan30 Jul 27, 2016
4d35b2f
Merge pull request #1271 from liuxuan30/master
liuxuan30 Jul 27, 2016
3dbd57b
Work on x-values instead of x-indices (free for all :-)
danielgindi Jul 14, 2016
6af7421
Merge branch 'x-indices' into v3
danielgindi Jul 27, 2016
3a0f638
Improvement for pie slice spacing calculation
danielgindi Aug 2, 2016
141128c
Example improvements
danielgindi Aug 2, 2016
d0e05d8
Docs improvements
danielgindi Aug 2, 2016
f49ef5f
Major work on highlights
danielgindi Aug 2, 2016
2f00975
ChartMarker is now a protocol, and we have ChartMarkerView/Image helpers
danielgindi Aug 3, 2016
761ca85
Improvements regarding irrelevant inherited methods
danielgindi Aug 3, 2016
ee1abfd
Added feature to change color of "no data" text
danielgindi Aug 3, 2016
77d1bf3
More work on highlights
danielgindi Aug 4, 2016
cbb5f66
Viewport enhancements for better horizontal bar support
danielgindi Aug 4, 2016
729b7d9
X-axis renderer enhancements for better horizontal bar support
danielgindi Aug 4, 2016
71b2655
Minor improvement to valueFormatter
danielgindi Aug 4, 2016
f0dafa8
Completed copy routine for scatter dataset
danielgindi Aug 4, 2016
c0d6fcd
Pie: Renamed `drawSliceTextEnabled` to `drawEntryLabelsEnabled`
danielgindi Aug 4, 2016
5835e8c
Pie: Added feature to offset center text
danielgindi Aug 4, 2016
abedb49
Pie: Separate color/font for entry labels (defaults to value color/font)
danielgindi Aug 4, 2016
184f097
Minor improvements to demo
danielgindi Aug 4, 2016
b6a2d18
Minor refactoring of variable names
danielgindi Aug 4, 2016
db836c3
Example cleanup
danielgindi Aug 5, 2016
4772adb
Refactored scatter shape rendering into interface and renderers
danielgindi Aug 5, 2016
d2b344f
Improved docs
danielgindi Aug 5, 2016
16ec10f
Removed deprecated --var / var--
danielgindi Aug 5, 2016
69bd3b9
Update README.md
danielgindi Aug 5, 2016
bcabf06
Dropped iOS 7.0 support from README (Closes #601)
danielgindi Aug 5, 2016
f48fbfc
Merge pull request #1245 from liuxuan30/ImproveComment
liuxuan30 Aug 5, 2016
f484ab3
Fixed a RadarChart bug where value labels were misplaced
danielgindi Aug 5, 2016
4f8b68a
Realm fixes
danielgindi Aug 5, 2016
9582c15
Improvements to zoom methods
danielgindi Aug 7, 2016
faab0ac
Legend improvements
danielgindi Aug 7, 2016
c76d53a
DRYed some code
danielgindi Aug 7, 2016
332fb3b
Adjusted maxHighlightDistance defaults
danielgindi Aug 7, 2016
5043834
Removed NaN check for highlight.
danielgindi Aug 7, 2016
9cf7591
Cleanup these comments
danielgindi Aug 7, 2016
e2d0ee4
`drawBarShadowEnabled` is working again
danielgindi Aug 7, 2016
1b3f79a
Do not invalidate here by default, like other zoom methods
danielgindi Aug 8, 2016
90b8454
Simplified scatter shape enum model
danielgindi Aug 8, 2016
a9ee2b5
These return a single pixel (x/y), for values (x value and y value)
danielgindi Aug 8, 2016
6fbbbaf
Renamed x-pos to x-value where appropriate
danielgindi Aug 8, 2016
dd53bbe
Renamed ChartMarker -> IChartMarker
danielgindi Aug 8, 2016
c9fd582
Namespace `Marker` names only for Objc (Swift 2.2)
danielgindi Aug 8, 2016
97bbce1
Do not force unwrap here
danielgindi Aug 8, 2016
96d510e
Fix for comments
danielgindi Aug 8, 2016
48f21da
More improvements to Markers, default behaviour constraint to view size
danielgindi Aug 8, 2016
9bf669a
Docs
danielgindi Aug 8, 2016
5e143be
The highlight breaking changes are a chance to use @objc(name) feature
danielgindi Aug 8, 2016
75b16fc
Use @objc(name) feature for rarely used classes (by users)
danielgindi Aug 8, 2016
31451ab
Improved entryIndex rounding method
danielgindi Aug 8, 2016
3a02b85
Fixed drawing bounds for some of the charts
danielgindi Aug 8, 2016
1a22cc1
Removed unused yValueForXValue / yValuesForXValue
danielgindi Aug 8, 2016
7867f4b
Set a default shape renderer
danielgindi Aug 8, 2016
c7f27a7
Take the correct barData object here
danielgindi Aug 8, 2016
19230cd
Fixed combined chart highlight with bar data
danielgindi Aug 9, 2016
ea193c5
Minor refactoring
danielgindi Aug 9, 2016
55fe33d
Removed the extra offset that messed up legend location
danielgindi Aug 9, 2016
57c975e
Cache XBounds object
danielgindi Aug 9, 2016
cf2b926
Breaking change: `valueFormatter` now accepts an IValueFormatter
danielgindi Aug 9, 2016
07981f9
Avoid x values in Pie's calcMinMax
danielgindi Aug 9, 2016
800e18f
This workaround is not required in the newer compilers
danielgindi Aug 9, 2016
4bc69a2
Renamed formatter interfaces
danielgindi Aug 9, 2016
52fe95d
Avoid truncating using Int(...), it overflows
danielgindi Aug 9, 2016
69777ad
Corrected formula for 29-feb :-)
danielgindi Aug 9, 2016
c5407e8
Some minor bug fixes for formatters
danielgindi Aug 9, 2016
acaf6de
Polished demos
danielgindi Aug 9, 2016
4b3b9fe
More improvements to examples
danielgindi Aug 9, 2016
fc189f3
These should be internal
danielgindi Aug 10, 2016
1e091d9
Fixed xAxis min/max calculation typo
danielgindi Aug 10, 2016
707dd3f
Added helper to generate a fill formatter with a closure (block)
danielgindi Aug 10, 2016
647df50
Added more samples
danielgindi Aug 10, 2016
adebfaf
Updated tests
danielgindi Aug 10, 2016
9db9042
Set default barWidth to match old default behaviour
danielgindi Aug 10, 2016
cd4a473
Renamed axisMinValue/axisMaxValue to axisMinimum/axisMaximum
danielgindi Aug 12, 2016
bcbcfda
Merge branch 'v3'
danielgindi Aug 12, 2016
6979fe5
Cleaned up header comments
danielgindi Aug 12, 2016
639a758
Removed deprecated startAtZero properties
danielgindi Aug 12, 2016
2b6ac7c
When only one of scaleXEnabled or scaleYEnabled is effective
essoecc Aug 14, 2016
72b6fb3
Docs
danielgindi Aug 14, 2016
b4282a8
Merge pull request #1319 from essoecc/scaleEnabled
danielgindi Aug 14, 2016
23af036
Cleanup
danielgindi Aug 14, 2016
d723224
Use EPSILON instead of an arbitrary value (Fixes #1239)
danielgindi Aug 14, 2016
e628b7a
Fix dataset update in Dual line chart demo (Fixes #1250)
danielgindi Aug 14, 2016
a8cf54a
Merge pull request #1226 from liuxuan30/turnOffBarShadow
danielgindi Aug 14, 2016
c05fbd8
Add half line width to clipping rect of grid/limit lines (Fixes #1204)
danielgindi Aug 14, 2016
6f51a55
Simplified legend entries configuration. Option to style dataset form.
danielgindi Aug 14, 2016
e01c1be
Added feature for dashing legend line forms
danielgindi Aug 14, 2016
fadea4d
Change default formLineWidth to match the default on MPAndroidChart
danielgindi Aug 14, 2016
5e53bf3
neededWidth should be enough here. formSize has no meaning globally.
danielgindi Aug 14, 2016
3b459cc
Renamed those classes too. Cleaner now. Should be too breaking...
danielgindi Aug 14, 2016
d7769e6
Take care of edge cases when calculating intervals (labelCount == 0)
danielgindi Aug 15, 2016
ee4de2b
autoScaleMinMax is working again (Fixes #1209)
danielgindi Aug 15, 2016
cbd7bf7
Minor refactoring (Closes #1187)
danielgindi Aug 15, 2016
22711d6
Fixed reversed condition from cbd7bf7
danielgindi Aug 15, 2016
337fdea
It's clearer this way
danielgindi Aug 15, 2016
27930d9
Fill before stroke - because the fill may cover half of a thick stroke
danielgindi Aug 15, 2016
c78d35a
Added those new classes to tvOS/macOS targets
danielgindi Aug 15, 2016
576b5c0
Migrated viewFromXib to macOS
danielgindi Aug 15, 2016
03c2700
Call `print` under `Swift` namespace, due to Cocoa ambiguity in NSView
danielgindi Aug 15, 2016
2e117e3
Migrated macOS demos to Charts 3.0
danielgindi Aug 15, 2016
cee0c80
Use an optional for _displayLink (Fixes #1336)
danielgindi Aug 22, 2016
3ab9b4e
Corrected LineChartRenderer cubicFill x range
danielgindi Aug 29, 2016
6f969aa
Fixed horizontal cubic calculation bug introduced when removing x-index
danielgindi Aug 29, 2016
6f49bd2
Avoid using deprecated property in demo
danielgindi Aug 29, 2016
197245f
Updated test screenshots
danielgindi Aug 29, 2016
5e020a8
Animating the wrong axis for the starting point
danielgindi Aug 29, 2016
7af3bff
migrate Chart v3 code in master to swift 2.3 syntax
liuxuan30 Sep 1, 2016
5a1a7ce
Merge branch 'Swift-2.3' into V3-Swift2.3
liuxuan30 Sep 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Charts.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Pod::Spec.new do |s|
s.subspec "Realm" do |ss|
ss.source_files = "ChartsRealm/Classes/**/*.swift"
ss.dependency "Charts/Core"
ss.dependency "RealmSwift", "~> 0.97"
ss.dependency "RealmSwift", "~> 1.0.2"
end
end
2 changes: 1 addition & 1 deletion Charts/Cartfile.private
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "facebook/ios-snapshot-test-case" ~> 2.1
github "facebook/ios-snapshot-test-case" ~> 2.1.2
2 changes: 1 addition & 1 deletion Charts/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "facebook/ios-snapshot-test-case" "2.1.1"
github "facebook/ios-snapshot-test-case" "2.1.2"
768 changes: 464 additions & 304 deletions Charts/Charts.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
15 changes: 8 additions & 7 deletions Charts/ChartsTests/BarChartTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ class BarChartTests: FBSnapshotTestCase
99, 14, 84, 48, 40, 71, 106, 41, 45, 61]

var entries: [ChartDataEntry] = Array()
var xValues: [String] = Array()

for (i, value) in values.enumerate()
{
entries.append(BarChartDataEntry.init(value: value, xIndex: i))
xValues.append("\(i)")
entries.append(BarChartDataEntry(x: Double(i), y: value))
}

dataSet = BarChartDataSet(yVals: entries, label: "Bar chart unit test data")
dataSet = BarChartDataSet(values: entries, label: "Bar chart unit test data")

let data = BarChartData(dataSet: dataSet)
data.barWidth = 0.85;

chart = BarChartView(frame: CGRectMake(0, 0, 480, 350))
chart.leftAxis.axisMinValue = 0.0
chart.rightAxis.axisMinValue = 0.0
chart.data = BarChartData(xVals: xValues, dataSet: dataSet)
chart.leftAxis.axisMinimum = 0.0
chart.rightAxis.axisMinimum = 0.0
chart.data = data
}

override func tearDown()
Expand Down
12 changes: 5 additions & 7 deletions Charts/ChartsTests/LineChartTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,18 @@ class LineChartTests: FBSnapshotTestCase
99, 14, 84, 48, 40, 71, 106, 41, 45, 61]

var entries: [ChartDataEntry] = Array()
var xValues: [String] = Array()

for (i, value) in values.enumerate()
{
entries.append(ChartDataEntry.init(value: value, xIndex: i))
xValues.append("\(i)")
entries.append(ChartDataEntry(x: Double(i), y: value))
}

dataSet = LineChartDataSet(yVals: entries, label: "First unit test data")
dataSet = LineChartDataSet(values: entries, label: "First unit test data")

chart = LineChartView(frame: CGRectMake(0, 0, 480, 350))
chart.leftAxis.axisMinValue = 0.0
chart.rightAxis.axisMinValue = 0.0
chart.data = LineChartData(xVals: xValues, dataSet: dataSet)
chart.leftAxis.axisMinimum = 0.0
chart.rightAxis.axisMinimum = 0.0
chart.data = LineChartData(dataSet: dataSet)
}

override func tearDown()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//
// ChartAnimator.swift
// Animator.swift
// Charts
//
// Created by Daniel Cohen Gindi on 3/3/15.
//
// Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
// A port of MPAndroidChart for iOS
// Licensed under Apache License 2.0
Expand All @@ -18,31 +16,32 @@ import CoreGraphics
import UIKit
#endif

@objc
public protocol ChartAnimatorDelegate
@objc(ChartAnimatorDelegate)
public protocol AnimatorDelegate
{
/// Called when the Animator has stepped.
func chartAnimatorUpdated(chartAnimator: ChartAnimator)
func animatorUpdated(chartAnimator: Animator)

/// Called when the Animator has stopped.
func chartAnimatorStopped(chartAnimator: ChartAnimator)
func animatorStopped(chartAnimator: Animator)
}

public class ChartAnimator: NSObject
@objc(ChartAnimator)
public class Animator: NSObject
{
public weak var delegate: ChartAnimatorDelegate?
public weak var delegate: AnimatorDelegate?
public var updateBlock: (() -> Void)?
public var stopBlock: (() -> Void)?

/// the phase that is animated and influences the drawn values on the x-axis
public var phaseX: CGFloat = 1.0
public var phaseX: Double = 1.0

/// the phase that is animated and influences the drawn values on the y-axis
public var phaseY: CGFloat = 1.0
public var phaseY: Double = 1.0

private var _startTimeX: NSTimeInterval = 0.0
private var _startTimeY: NSTimeInterval = 0.0
private var _displayLink: NSUIDisplayLink!
private var _displayLink: NSUIDisplayLink?

private var _durationX: NSTimeInterval = 0.0
private var _durationY: NSTimeInterval = 0.0
Expand All @@ -69,9 +68,9 @@ public class ChartAnimator: NSObject

public func stop()
{
if (_displayLink != nil)
if _displayLink != nil
{
_displayLink.removeFromRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
_displayLink?.removeFromRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
_displayLink = nil

_enabledX = false
Expand All @@ -85,7 +84,7 @@ public class ChartAnimator: NSObject

if (delegate != nil)
{
delegate!.chartAnimatorUpdated(self)
delegate!.animatorUpdated(self)
}
if (updateBlock != nil)
{
Expand All @@ -95,7 +94,7 @@ public class ChartAnimator: NSObject

if (delegate != nil)
{
delegate!.chartAnimatorStopped(self)
delegate!.animatorStopped(self)
}
if (stopBlock != nil)
{
Expand All @@ -122,7 +121,7 @@ public class ChartAnimator: NSObject
}
else
{
phaseX = CGFloat(elapsed / duration)
phaseX = Double(elapsed / duration)
}
}
if (_enabledY)
Expand All @@ -141,7 +140,7 @@ public class ChartAnimator: NSObject
}
else
{
phaseY = CGFloat(elapsed / duration)
phaseY = Double(elapsed / duration)
}
}
}
Expand All @@ -154,7 +153,7 @@ public class ChartAnimator: NSObject

if (delegate != nil)
{
delegate!.chartAnimatorUpdated(self)
delegate!.animatorUpdated(self)
}
if (updateBlock != nil)
{
Expand Down Expand Up @@ -193,10 +192,10 @@ public class ChartAnimator: NSObject
// Take care of the first frame if rendering is already scheduled...
updateAnimationPhases(_startTimeX)

if (_enabledX || _enabledY)
if _enabledX || _enabledY
{
_displayLink = NSUIDisplayLink(target: self, selector: #selector(ChartAnimator.animationLoop))
_displayLink.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
_displayLink = NSUIDisplayLink(target: self, selector: #selector(animationLoop))
_displayLink?.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
}
}

Expand Down Expand Up @@ -259,10 +258,10 @@ public class ChartAnimator: NSObject

if (_enabledX || _enabledY)
{
if _displayLink === nil
if _displayLink == nil
{
_displayLink = NSUIDisplayLink(target: self, selector: #selector(ChartAnimator.animationLoop))
_displayLink.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
_displayLink = NSUIDisplayLink(target: self, selector: #selector(animationLoop))
_displayLink?.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
}
}
}
Expand Down Expand Up @@ -303,10 +302,10 @@ public class ChartAnimator: NSObject

if (_enabledX || _enabledY)
{
if _displayLink === nil
if _displayLink == nil
{
_displayLink = NSUIDisplayLink(target: self, selector: #selector(ChartAnimator.animationLoop))
_displayLink.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
_displayLink = NSUIDisplayLink(target: self, selector: #selector(animationLoop))
_displayLink?.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
}
}
}
Expand Down
Loading