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