kaiserfarrell / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Option to anchor labels on center instead of corner #473

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In CPTPlot.m, there is a method called updateContentAnchorForLabel:. This 
method changes each label's contentAnchorPoint property from the default center 
(0.5, 0.5) to one of the corners, e.g.  (0.39, 0).

Changing the anchor in this way causes centering problems, especially when 
using CPTPieChart. To illustrate, see the attached screenshots. The code for 
each plot is identical, except that in the center-anchored version, 
updateContentAnchorForLabel: is a no-op. Note that the labels are correctly 
centered for this case.

There may be times when corner anchoring is needed, and of course there are 
backward compatibility issues in simply changing the default anchoring from 
corner to center. Therefore I am submitting a patch that adds a property 
"adjustLabelAnchors" on CPTPlot. It allows corner anchoring to be turned on or 
off by enabling or disabling the updateContentAnchorForLabel: method.

Original issue reported on code.google.com by tre...@vocaro.com on 7 Nov 2012 at 3:09

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 7 Nov 2012 at 11:39

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 17 Aug 2013 at 2:14

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 3033e20068c1.

Original comment by eskr...@mac.com on 17 Aug 2013 at 4:29