Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8296815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:09:50+00:00 2026-06-08T15:09:50+00:00

I am a beginner in iPhone programing. I need to create circles like Figure

  • 0

I am a beginner in iPhone programing. I need to create circles like Figure 1, where it should be divided in six different parts with four different levels (see Figure 1). Furthermore I need to create a circle according to a given data as it is shown on Figure 2. Each part should be click-able to zoom the specific part (see Figure 3).

enter image description here

Figure 1: Illustrates six different colors, where two of them are divided in one and the rest four of them are divided in three parts.
enter image description here

Figure 2: Shows the results of different categories in different levels.
enter image description here

Figure 3: Is a zoomed vision of chosen category.

I have a storyboard which loads loads a custom UIView and using drawRect method to draw the circle.

The question is now, how to create the pie chart like the figures?

I have tried lots of things and could use some guideness – or please give an example of this.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:09:53+00:00Added an answer on June 8, 2026 at 3:09 pm

    Pie Chart Example:

    int sum = 0;
    CGFloat offset;
    CGFloat angleArray[numberOfSections+1];
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetAllowsAntialiasing(context, true);
    CGContextSetShouldAntialias(context, true);
    
    for(int i=0; i<numberOfSections; i++) {
        sum += angle;
    }
    
    for(int i=0; i<numberOfSections; i++) {
        angleArray[i] = (float)((angle)/(float)sum)*(2*M_PI); 
        CGContextMoveToPoint(context, radius, radius);
    
        if(i == 0) {
            CGContextAddArc(context, radius, radius, radius, 0, angleArray[i], 0);
        } else {
            CGContextAddArc(context, radius, radius, radius, offset, (offset+angleArray[i]), 0);
        }
        offset += angleArray[i];
    
        CGContextSetFillColorWithColor(context, ((UIColor *)[hjulColorArray objectAtIndex:i]).CGColor);
        CGContextClosePath(context); 
        CGContextFillPath(context);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a beginner of iPhone app programing. I really don't like the way
Objective-C/iPhone beginner here...looking for a shove in the right direction. I need to create
I am having a small problem. I am a beginner to iPhone programming so
I am a beginner iPhone app developer and I am trying to show the
What resources are great to provide information on using SQLite for beginner iPhone developers?
I m the beginner in iphone software development. I developing the application on skin
I am the beginner in iphone development. I develop an application in which i
i m the beginner in iphone. I want the divide the circle in equal
Special thanks in advance for sending me answer........ I m the beginner in iphone
I'm a beginner with Objective C and iPhone development. It's there any way to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.