Last active
August 29, 2015 14:27
-
-
Save mbcrump/470db951ccf51dc60494 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
super.viewDidLoad() | |
let chart = TKChart(frame: CGRectInset(self.view.bounds, 15, 15)) | |
chart.autoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight | |
self.view.addSubview(chart) | |
var items = [TKChartDataPoint]() | |
for i in 0..<8 { | |
items.append(TKChartDataPoint(x:Int(arc4random()%100), y:(i+1))) | |
} | |
let series = TKChartBarSeries(items:items) | |
series.style.paletteMode = TKChartSeriesStylePaletteMode.UseItemIndex | |
series.selectionMode = TKChartSeriesSelectionMode.DataPoint | |
chart.allowAnimations = true | |
chart.addSeries(series) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment