Pie Chart and bar chart

Source: Internet
Author: User

Pie Chart and bar chart

 

 

Start:

After you click the pie chart, the pie chart is displayed, and the text is displayed in the lower left corner ,:

Project architecture diagram. Note that this project imports a third-party library pieChat, which contains two files: PieChartView. h. PieChartView. m

 

RootViewControler. m

-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. optional * valueArray = [[NSMutableArray alloc] values: [NSNumber numberWithInt: 1], [NSNumber numberWithInt: 1], [NSNumber numberWithInt: 1], [NSNumber numberWithInt: 3], [NSNumber numberWithInt: 2], nil]; NSMutableArray * colorArray = [[NSMutableArray alloc] initWithObjects: [UIColor blueColor], [UIColor redColor], [UIColor orangeColor], [UIColor greenColor], [UIColor purpleColor], nil]; // you must first create a container view of the same size, add PieChartView to UIView * container = [[UIView alloc] initWithFrame: CGRectMake (320-250)/2, 90,250,250)]; pieChartView * pieView = [[PieChartView alloc] initWithFrame: CGRectMake (0, 0,250,250)]; [container addSubview: pieView]; pieView. mValueArray = [NSMutableArray arrayWithArray: valueArray]; pieView. mColorArray = [NSMutableArray arrayWithArray: colorArray]; pieView. mInfoTextView = [[UITextView alloc] initWithFrame: CGRectMake (20,350,300, 80)]; pieView. mInfoTextView. backgroundColor = [UIColor clearColor]; pieView. mInfoTextView. editable = NO; pieView. mInfoTextView. userInteractionEnabled = NO; [self. view addSubview: container]; [self. view addSubview: pieView. mInfoTextView];}

 


How to create an excel pie chart?

How to Create a pie chart with the remaining number of sets. Shows the sales ratio of each apartment. Is to calculate the insert-chart-pie chart first select the data for the entire chart, such as the occupancy rate and month, insert

How to create an excel pie chart?

How to Create a pie chart with the remaining number of sets. Shows the sales ratio of each apartment. Is to calculate the insert-chart-pie chart first select the data for the entire chart, such as the occupancy rate and month, insert

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.