Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-20-2009, 01:25 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Colombo, Sri Lanka
Posts: 58
Send a message via Yahoo to tharindufit Send a message via Skype™ to tharindufit
Default Draw a Pie Chart using quartz

Hi I want to draw a pie chart in my iPhone Application, I could do it using the following code I found in web
Drawing Pie Charts using iPhone SDK
Now I want to display text with the corner of the arcs, How can I do this with quartz, I want to get the points to draw my text on Pie Chart. How can I get exact points
tharindufit is offline   Reply With Quote
Old 01-20-2009, 11:43 AM   #2 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

You can easily draw strings at specified points by using drawAtPoint:withFont:

I think to determine the points you'll need to do some trig based on the size and position of your circle.
PhoneyDeveloper is offline   Reply With Quote
Old 01-21-2009, 11:45 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Colombo, Sri Lanka
Posts: 58
Send a message via Yahoo to tharindufit Send a message via Skype™ to tharindufit
Default

Sorry I could not mention it clearly, But I wanted to display my text around the pie chart, I can draw it below the chart. The issue is I could not get points to draw around the chart.
Thanks,
Tharindu

Last edited by tharindufit; 01-21-2009 at 11:46 PM. Reason: mistake
tharindufit is offline   Reply With Quote
Old 01-22-2009, 12:00 AM   #4 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

Right. You can draw your text wherever you like. If you want it to go to particular places related to the slices of your pie you need to use trigonometry to determine where those places are based on the center of the circle, the radius of the circle, and where the slices are.
PhoneyDeveloper is offline   Reply With Quote
Old 01-22-2009, 12:20 AM   #5 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Colombo, Sri Lanka
Posts: 58
Send a message via Yahoo to tharindufit Send a message via Skype™ to tharindufit
Thumbs up

Thanks a lot, Oh I could not think of such small thing, It's just some mathematics.
tharindufit is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, pie chart, quartz

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 246
14 members and 232 guests
ADY, Alsahir, cacao, dacapo, Dani77, Desert Diva, djohnson, HemiMG, jansan, M@realobjects, MarkC, prchn4christ, smethorst
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,762
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:56 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0