0
votes

TL;DR Is there a way to set a custom axis label's tick location in Swift (using core-plot lib)?

i want to set custom labels for an axis in a CPTXYGraph. I have created the label and set it to the xAxis like so:

xAxis.axisLabels = NSSet(array: customLabels)

that part is fine. What is NOT fine, is that I can't set the location or index of the label to match it up with the 'tick' on the xAxis.

in Objective C, you can set a property

label.tickLocation

but I can't find the corresponding property or any pertinent method in Swift. I can't find any class references in Swift, either. Is there a way to set the label's tick location in Swift?

1
why the down arrows? - Jack
The Swift API is the same as Objective-C, with the obvious differences in language syntax. Have you looked at the online docs? - Eric Skroch
yes, i've looked over that document. i want a property called tickLocation but there is no such property in Swift. i can't find any documentation for Swift that would suggest another way to get to this functionality - Jack

1 Answers

0
votes

there is no property called tickLocation because NSDecimal was done away with in Swift. I had to extend CPTAxisLabel and create my own method setTickLocation. Fun stuff