IOS and ios
Due to the needs of the new project, we need to draw a circular chart. Since we have never touched this kind of project before (I am a cainiao), I found a case in cocochina. I think it is okay to share it.
Github address https://github.com/zhouxing5311/ZZCircleProgress
This is very simple to use.
The author opens many interfaces that can be changed as needed.
It's okay to declare a tired class.
The specific implementation code is as follows:
Maybe my code is a little different. I added some elements myself.
// No small dots, same animation time self. zzCircleProgress = [[ZZCircleProgress alloc] Progress: CGRectMake (JdryScreeWidth * 0.75) + 9, 16, 50, 50) pathBackColor: BACK_COLOR pathFillColor: BLUE_COLOR startAngle: 270 strokeWidth: 4]; self. zzCircleProgress. showPoint = NO; self. zzCircleProgress. notAnimated = YES; self. zzCircleProgress. progress = 0.9; self. zzCircleProgress. fontSize = 16.0; // self. zzCircleProgress. animationModel = CircleIncreaseByProgress; self. zzCircleProgress. textColor = BLUE_COLOR; self. zzCircleProgress. labelStr = [NSString stringWithFormat: @ "% d %", (int) (self. zzCircleProgress. progress * 100)]; [self addSubview: self. zzCircleProgress];