piaoyongren / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

addLabelLayers in CPPieChart not implemented #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a pie chart
2. Implement the optional interface method sliceLabelForPieChart
3. No labels are shown, since sliceLabelForPieChart is not called. 
addLabelLayers is not 
implemented by CPPieChart.

What is the expected output? What do you see instead?
The expected output are labels for the different slices of the pie chart. 
Instead I see no labels.

What version of the product are you using? On what operating system?
Latest version (I think) as available in mercurial (13/4/2010). On Mac OS X 
10.6.3.

Please provide any additional information below.
Programming with iPhone SDK 3.1.3.

It would be great if that feature could be implemented some time soon. If there 
is something I 
can help with to get this done earlier let me know.

Thank you,
Rüdiger

Original issue reported on code.google.com by rlin...@gmail.com on 13 Apr 2010 at 3:07

GoogleCodeExporter commented 9 years ago

Original comment by drewmcco...@mac.com on 13 Apr 2010 at 7:06

GoogleCodeExporter commented 9 years ago

Original comment by drewmcco...@mac.com on 21 Apr 2010 at 7:59

GoogleCodeExporter commented 9 years ago
How hard is this issue for someone not yet very used to CorePlot internals?

Original comment by asand...@gmail.com on 26 Apr 2010 at 6:15

GoogleCodeExporter commented 9 years ago
Probably not too hard. I would start by doing something similar to how axis 
labels are handled and change the 
label positioning code to something appropriate for a pie chart.

Original comment by eskr...@mac.com on 26 Apr 2010 at 10:42

GoogleCodeExporter commented 9 years ago
Please implement this ASAP. Is there any other immediate fix for this lie 
adding a label outside the pie. When I 
try it is coming iverted.

Original comment by hrishike...@gmail.com on 28 Apr 2010 at 3:06

GoogleCodeExporter commented 9 years ago
Are you using CPTextLayer to draw text? It automatically takes care of 
inverting the context on iPhone.

Original comment by eskr...@mac.com on 28 Apr 2010 at 10:44

GoogleCodeExporter commented 9 years ago
Can you please give me an example of how to add CPTextLayer to pie chart for 
labels. Please help.

Original comment by hrishike...@gmail.com on 4 May 2010 at 1:55

GoogleCodeExporter commented 9 years ago
Look in the CPXYAxis class at how labels are added there. Using that as a 
guide, you should be able to figure it 
out.

Original comment by drewmcco...@mac.com on 4 May 2010 at 2:08

GoogleCodeExporter commented 9 years ago
I figured it out. Thanks. You guys rock...

Original comment by hrishike...@gmail.com on 4 May 2010 at 2:24

GoogleCodeExporter commented 9 years ago
If you do come up with something clean that works, please consider sending up a 
patch, or your revised class 
for inclusion.

Original comment by drewmcco...@mac.com on 4 May 2010 at 2:34

GoogleCodeExporter commented 9 years ago
I am not an expert in iPhone programming. SO I think I am not qualified for 
that. I am not able to chane the 
position of the text. Can you please help.

CPTextLayer *layer = [[[CPTextLayer alloc] initWithText:@"ddddd"] autorelease];

    layer.bounds = CGRectMake(0, 0, layer.preferredFrameSize.width,
                              layer.preferredFrameSize.height);
    layer.position = CGPointMake(10, 150);
    layer.borderWidth = 1;
    layer.anchorPoint = CGPointMake(0,0);

    [hostingView.hostedLayer addSublayer:layer]; 

Original comment by hrishike...@gmail.com on 4 May 2010 at 2:37

GoogleCodeExporter commented 9 years ago
It looks right. Maybe you have to add the sublayer and then set the position. 

Original comment by drewmcco...@mac.com on 4 May 2010 at 2:40

GoogleCodeExporter commented 9 years ago
I am sorry. I figured it out.

Original comment by hrishike...@gmail.com on 4 May 2010 at 2:40

GoogleCodeExporter commented 9 years ago
Drew I am working on an interesting iPhone project which basically displays 
CPU/MIPS/meter/io consumption in 
chart(bar/line/pie) for a legacy mainframe system. This is going to be a high 
profile app. I am curious  to know 
what you think about the future of the core-plot package and the community's 
interest on this. I am totally 
relying on this package to roll my app.

Original comment by hrishike...@gmail.com on 4 May 2010 at 2:46

GoogleCodeExporter commented 9 years ago
I have a requirement to draw a chart like the one I have attached. Can the 
community help me with that.

Original comment by hrishike...@gmail.com on 4 May 2010 at 2:49

Attachments:

GoogleCodeExporter commented 9 years ago
Core Plot is certainly healthy, and I don't expect it to go anywhere.
The plot you show would not be easy to do with Core Plot at the moment. It 
looks like we would need a new plot 
class to handle that properly, though you may be able to fake it.

Original comment by drewmcco...@mac.com on 4 May 2010 at 2:54

GoogleCodeExporter commented 9 years ago
Pie chart labeling is working.

Original comment by drewmcco...@mac.com on 8 Jan 2011 at 9:56