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