-
-
Save prabakarviji/e34d989c7233664e9a6d2d34fa174742 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
let axisSet = graph.axisSet as! CPTXYAxisSet | |
let axisTextStyle = CPTMutableTextStyle() | |
axisTextStyle.color = CPTColor.white() | |
axisTextStyle.fontName = "HelveticaNeue-Bold" | |
axisTextStyle.fontSize = 10.0 | |
axisTextStyle.textAlignment = .center | |
let lineStyle = CPTMutableLineStyle() | |
lineStyle.lineColor = CPTColor.white() | |
lineStyle.lineWidth = 5 | |
let gridLineStyle = CPTMutableLineStyle() | |
gridLineStyle.lineColor = CPTColor.gray() | |
gridLineStyle.lineWidth = 0.5 | |
if let x = axisSet.xAxis { | |
x.majorIntervalLength = 20 | |
x.minorTicksPerInterval = 5 | |
x.labelTextStyle = axisTextStyle | |
x.minorGridLineStyle = gridLineStyle | |
x.axisLineStyle = lineStyle | |
x.axisConstraints = CPTConstraints(lowerOffset: 0.0) | |
x.delegate = self | |
} | |
if let y = axisSet.yAxis { | |
y.majorIntervalLength = 5 | |
y.minorTicksPerInterval = 5 | |
y.minorGridLineStyle = gridLineStyle | |
y.labelTextStyle = axisTextStyle | |
y.alternatingBandFills = [CPTFill(color: CPTColor.init(componentRed: 255, green: 255, blue: 255, alpha: 0.03)),CPTFill(color: CPTColor.black())] | |
y.axisLineStyle = lineStyle | |
y.axisConstraints = CPTConstraints(lowerOffset: 0.0) | |
y.delegate = self | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment