Closed GoogleCodeExporter closed 8 years ago
I don't see why this is needed. Setting either the labelTextStyle or
labelFormatter to nil will remove the data labels. Both properties default to
nil, so you have to explicitly set them to get labels to appear in the first
place.
Original comment by eskr...@mac.com
on 31 Oct 2012 at 1:19
[deleted comment]
Setting labelTextStyle to nil does not remove the data labels. The labels are
drawn anyway. I verified this with CPTPieChart in the Plot Gallery and my own
app. It appears that the style set in the layer returned by dataLabelForPlot:
is used regardless of the labelTextStyle value.
The showLabels property is better because it overrides all other label-related
properties when determining whether or not to draw the labels. It is also more
intuitive (since it's not obvious that changing the text style is the way to
show/hide labels). It's slightly easier to use, too -- for instance,
temporarily hiding the labels does not require saving/restoring the text style.
Original comment by tre...@vocaro.com
on 31 Oct 2012 at 6:38
If you're providing labels (or anything else) via the datasource, you have to
call -reloadData on the plot and return new labels or nil to hide them.
Original comment by eskr...@mac.com
on 31 Oct 2012 at 11:43
Yes, that would achieve the same effect, but I wouldn't call it easy (see
title). You'd have to add a "showLabels" flag to the data source, plus some
additional logic to test it and optionally call reloadData. And there'd also
have to be some communication path between the view controller and the data
source to change this flag. It gets messy. I'm proposing this showLabels
property as a way to push that extra complexity into Core Plot and thereby
simplify the client code.
Original comment by tre...@vocaro.com
on 2 Nov 2012 at 2:14
Original comment by eskr...@mac.com
on 28 Apr 2013 at 4:26
This issue was closed by revision f4270c45ba49.
Original comment by eskr...@mac.com
on 28 Apr 2013 at 5:14
Original issue reported on code.google.com by
tre...@vocaro.com
on 30 Oct 2012 at 2:35Attachments: