Created
August 7, 2014 07:39
-
-
Save alwold/74434df3781388bc316a 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
// create graph | |
var graph = CPTXYGraph(frame: CGRectZero) | |
graph.title = "Hello Graph" | |
graph.paddingLeft = 0 | |
graph.paddingTop = 0 | |
graph.paddingRight = 0 | |
graph.paddingBottom = 0 | |
// hide the axes | |
var axes = graph.axisSet as CPTXYAxisSet | |
var lineStyle = CPTMutableLineStyle() | |
lineStyle.lineWidth = 0 | |
axes.xAxis.axisLineStyle = lineStyle | |
axes.yAxis.axisLineStyle = lineStyle | |
// add a pie plot | |
var pie = CPTPieChart() | |
pie.dataSource = self | |
pie.pieRadius = (self.view.frame.size.width * 0.9)/2 | |
graph.addPlot(pie) | |
self.graphView.hostedGraph = graph |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment