酷店

SSWCharts.m 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // SSWCharts.m
  3. // SSWCharts
  4. //
  5. // Created by WangShaoShuai on 2018/5/2.
  6. // Copyright © 2018年 com.sswang.www. All rights reserved.
  7. //
  8. #import "SSWCharts.h"
  9. @implementation SSWCharts
  10. -(instancetype)initWithChartType:(SSWChartsType)type{
  11. self = [super init];
  12. if (self) {
  13. self.chartType = type;
  14. }
  15. return self;
  16. }
  17. -(UILabel *)bubbleLab{
  18. if (!_bubbleLab) {
  19. _bubbleLab = [[UILabel alloc]init];
  20. _bubbleLab.bounds = CGRectMake(0, 0, 60, 20);
  21. _bubbleLab.textAlignment = NSTextAlignmentCenter;
  22. _bubbleLab.textColor = [UIColor whiteColor];
  23. // _bubbleLab.backgroundColor = [UIColor blueColor];
  24. _bubbleLab.hidden=YES;
  25. _bubbleLab.font = [UIFont fontWithName:@"Helvetica-Bold" size:10];
  26. }
  27. return _bubbleLab;
  28. }
  29. //添加动画
  30. -(CABasicAnimation *)animationWithDuration:(CFTimeInterval)duration{
  31. CABasicAnimation *anmiation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
  32. anmiation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
  33. anmiation.duration =duration;
  34. anmiation.fromValue=@(0);
  35. anmiation.toValue = @(1);
  36. return anmiation;
  37. }
  38. @end