Skip to content

Instantly share code, notes, and snippets.

@prabakarviji
Created May 1, 2020 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prabakarviji/7fb17072a6283a7d491878fd69d2c247 to your computer and use it in GitHub Desktop.
Save prabakarviji/7fb17072a6283a7d491878fd69d2c247 to your computer and use it in GitHub Desktop.
func configurePlot(){
plot = CPTScatterPlot()
let plotLineStile = CPTMutableLineStyle()
plotLineStile.lineJoin = .round
plotLineStile.lineCap = .round
plotLineStile.lineWidth = 2
plotLineStile.lineColor = CPTColor.white()
plot.dataLineStyle = plotLineStile
plot.curvedInterpolationOption = .catmullCustomAlpha
plot.interpolation = .curved
plot.identifier = "coreplot-graph" as NSCoding & NSCopying & NSObjectProtocol
guard let graph = hostView.hostedGraph else { return }
plot.dataSource = (self as CPTPlotDataSource)
plot.delegate = (self as CALayerDelegate)
graph.add(plot, to: graph.defaultPlotSpace)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment