Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.