Hi I need to show the String titles below the bars of my Bar Chart created from Core Plot. I have many places in Core Plot framework but didn't find how to put text below the bars? I need to show titles just like shown in the attached image.
Please suggest!
There are a couple of ways to make axis labels that are not numeric representations of the data value.
If you are plotting categorical data, you can set the scale type of the plot space to show categorical labels and return the text of the label from the datasource for the plot value (e.g., the bar location for a bar plot).
From the "Vertical Bar Chart" demo in the Plot Gallery example app:
If you're not plotting categorical data or you just need more control over the labels, you can create custom axis labels. Set the axis
labelingPolicy
toCPTAxisLabelingPolicyNone
, create a set of axis labels, and assign it to theaxisLabels
property. There are several demos in the example apps including the "Composite Plot" demo in the Plot Gallery example app. WithCPTAxisLabelingPolicyNone
, the tick marks and labels are independent, so if you want tick marks, you also need to set themajorTickLocations
and/orminorTickLocations
.