title: Core Plot with swift getting error : "Missing Argument for Parameter ‘frame’ in call"
body: <p>I am trying to use core plot with swift and I feel very close except for one error. My code so far is : </p>
  
  <pre><code>class ViewController: UIViewController, CPTPlotDataSource {
      @IBOutlet weak var graphView: CPTGraphHostingView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // 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
      }
  
      func numberOfRecordsForPlot(plot: CPTPlot!) -&gt; UInt {
          return 4
      }
  
      func numberForPlot(plot: CPTPlot!, field fieldEnum: UInt, recordIndex idx: UInt) -&gt; NSNumber! {
          return idx+1
      }
  
  
  
  }
  </code></pre>
  
  <p>The error i am getting is from the line : <code>var pie = CPTPieChart()</code> My error is : </p>
  
  <blockquote>
    <p>Core Plot with swift getting error : "Missing Argument for Parameter ‘frame’ in call"</p>
  </blockquote>
  
  <p>I am following a tutorial and it is possible that swift has changed, however I am new to the language and can't seem to solve this one. Thanks in advance.</p>