mike.tihonchik
mike.tihonchik

Reputation: 6933

CorePlot with Swift - bringing axis to the front

So, I am converting one of my projects that uses CorePlot to Swift. I have a graph that in addition to regular x- and y-axis I add two more. By default, the axis were hidden by the graph. I used the following code in Objective-C to show them over graph:

graph.plotAreaFrame.plotArea.topDownLayerOrder = @[@(CPTGraphLayerTypeAxisLines)];

Here is what it looks like: enter image description here

I was wondering how do I do that in Swift? I can't seem to set topDownLayerOrder without getting some sort of "can't assign to [AnyObject]!" message

Upvotes: 1

Views: 96

Answers (2)

mike.tihonchik
mike.tihonchik

Reputation: 6933

With the help of the co-worker, this is what we came up with:

graph.plotAreaFrame.plotArea.topDownLayerOrder = [CPTGraphLayerType.AxisLines.rawValue]

Upvotes: 1

Bannings
Bannings

Reputation: 10479

Try this:

graph.plotAreaFrame.plotArea.topDownLayerOrder = [CPTGraphLayerType.AxisLines.rawValue]

Upvotes: 3

Related Questions