Reputation: 7637
CPTMutableTextStyle *xLabelTextStyle = [CPTMutableTextStyle textStyle];
xLabelTextStyle.color = [CPTColor redColor];
CPTXYAxis *x = axisSet.xAxis;
x.labelTextStyle = xLabelTextStyle;
Using above code all x-axis labels text became red. My goal is to set multiple colors for these labels, some labels may be blue, other may be yellow, etc. How can I achieve this in Core Plot ?
Upvotes: 0
Views: 161
Reputation: 27381
You have at least two options:
Use custom axis labels. Each label can use a different text style.
Create a custom subclass of NSNumberFormatter
to use for the axis labelFormatter
. Override the -attributedStringForObjectValue:withDefaultAttributes:
method and have it return appropriately styled text for each label.
Upvotes: 1