效果图
![效果图](https://i-blog.csdnimg.cn/blog_migrate/c8023aa25e2cb6d016d0c684fc794602.png)
1 创建SKPPieChartView继承于UIView
2 SKPPieChartView.h
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ChartModel : NSObject
@property(nonatomic,assign)float bili;//总值为1
@property(nonatomic,strong)UIColor *color;
@end
@interface SKPPieChartView : UIView
@property(nonatomic,assign)CGFloat startAngle;//开始弧度默认为0度
-(void)drawChartWithChartModelArray:(NSArray<ChartModel*>*)chartModelArray;
@end
NS_ASSUME_NONNULL_END
3 SKPPieChartView.m
#import "SKPPieChartView.h"
@implementation ChartModel
@end
@interface SKPPieChartView ()
@property(nonatomic,strong)NSArray<ChartModel*> *chartModelArray;
@en