酷店

SSWCharts.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // SSWCharts.h
  3. // SSWCharts
  4. //
  5. // Created by WangShaoShuai on 2018/5/2.
  6. // Copyright © 2018年 com.sswang.www. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSInteger,SSWChartsType){
  10. SSWChartsTypePie,
  11. SSWChartsTypeLine,
  12. SSWChartsTypeBar
  13. };
  14. @protocol SSWChartsDelegate;
  15. @interface SSWCharts : UIView
  16. -(instancetype)initWithChartType:(SSWChartsType)type;
  17. @property(nonatomic,assign)SSWChartsType chartType;
  18. @property(nonatomic,strong)NSArray *percentageArr;//百分比数组 对应piechart
  19. @property(nonatomic)NSArray *colorsArr;//颜色组数 对应piechart
  20. @property(nonatomic)NSArray *titlesArr;//标题数组 对应piechart
  21. @property(nonatomic)UILabel *bubbleLab;//点击时提示泡泡
  22. @property(nonatomic,assign)BOOL showEachYValus;//是否显示每个Y值
  23. @property(nonatomic,assign)id<SSWChartsDelegate>delegate;
  24. -(CABasicAnimation *)animationWithDuration:(CFTimeInterval)duration;
  25. @end
  26. @protocol SSWChartsDelegate<NSObject>
  27. //
  28. @optional
  29. -(void)SSWChartView:(SSWCharts *)chartView didSelectIndex:(NSInteger)index;
  30. //
  31. -(void)SSWChartView:(SSWCharts *)chartView didSelectMutipleBarChartIndex:(NSArray *)index;
  32. @end