Is there a way to make tick mark (major tick mark) to be UIImage (custom graphics) instead of text?
I have values in one of the axis I need to present as icons.
I do not see any delegate for this but maybe someone knows the trick?
Is there a way to make tick mark (major tick mark) to be UIImage
Share
Axis labels can have any
CPTLayer(which is a direct subclass of Core Animation’sCALayer) as its content. Set your image as the layer background and build a custom label using this layer. Several of the Core Plot example apps demonstrate custom labels, although they all use text labels.You have two options for adding your custom labels to the graph:
Use the
CPTAxisLabelingPolicyNonelabeling policy. Create aNSSetcontaining your labels and set it to theaxisLabelsproperty on the axis. If you use this, remember that you must provide the major and/or minor tick locations in addition to the custom labels.Use any other labeling policy to generate the tick locations and implement the
-axis:shouldUpdateAxisLabelsAtLocations:axis delegate method. In your delegate, create new labels at the provided locations and returnNOto suppress the automatic labels.Eric