美文网首页
PNChart中的circleChart简单使用

PNChart中的circleChart简单使用

作者: 明月西楼_cd25 | 来源:发表于2017-11-03 15:45 被阅读0次

    要做这个这样的效果:


    自己写轮子也挺烦的,正好后面还要写曲线图什么的在网上找了个三方PNChart,pod继承进来包一下头文件#import 然后就可以用了,没什么好说的贴代码:

    self.circleChart = [[PNCircleChart alloc] initWithFrame:CGRectMake(0,0,148,148)

    total:@100current:@80clockwise:YES shadow:YES shadowColor:[UIColor lightGrayColor]];

    self.circleChart.backgroundColor=[UIColor clearColor];

    self.circleChart.displayAnimated= NO;//动画效果隐藏,一刷新就转挺烦的[self.circleChart setStrokeColor:[UIColor lightGrayColor]];

    [self.circleChart setStrokeColorGradientStart:[UIColor colorWithRed:6/255.0green:149/255.0blue:157/255.0alpha:1]];

    [self.circleChart strokeChart];

    self.circleChart.countingLabel.hidden= YES;//把那个百分号给去掉,我还要写别的东西呢[self.circleView addSubview:self.circleChart];

    背景透明了自己在view上面贴lable就好了,我是用xib拖得,懒。。

    相关文章

      网友评论

          本文标题:PNChart中的circleChart简单使用

          本文链接:https://www.haomeiwen.com/subject/tqvtmxtx.html