Created
July 11, 2017 04:44
-
-
Save devraj/955b2a429cd76dc284f17cab9c45dd5e to your computer and use it in GitHub Desktop.
Swift configuration for Purple Graph using ScrollableGraphView v3
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
private func paintGraphView() { | |
let graphView = ScrollableGraphView(frame: CGRect(x: 0, y: 0, width: 375, height: 350)) | |
let purpleColor = UIColor.colorFromHex("#8D2595") | |
barPlot.set(data: data, withLabels: labels) | |
barPlot.topMargin = 80 | |
barPlot.backgroundFillColor = UIColor.white | |
barPlot.lineColor = UIColor.clear | |
barPlot.lineStyle = .smooth | |
barPlot.shouldFill = true | |
barPlot.fillColor = self.view.backgroundColor as UIColor! | |
barPlot.shouldDrawDataPoint = true | |
barPlot.dataPointFillColor = purpleColor | |
barPlot.dataPointSpacing = 60 | |
barPlot.dataPointLabelFont = UIFont.boldSystemFont(ofSize: 10) | |
barPlot.dataPointLabelColor = purpleColor | |
barPlot.referenceLineThickness = 1 | |
barPlot.referenceLineLabelFont = UIFont.boldSystemFont(ofSize: 10) | |
barPlot.referenceLineColor = purpleColor.withAlphaComponent(0.25) | |
barPlot.referenceLineLabelColor = purpleColor | |
barPlot.shouldShowLabels = true | |
barPlot.dataPointLabelFont = UIFont.systemFont(ofSize: 10) | |
barPlot.dataPointLabelColor = purpleColor | |
barPlot.numberOfIntermediateReferenceLines = 5 | |
barPlot.rangeMax = 70 | |
self.view.addSubview(graphView) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment