美文网首页iOS Developer
iOS开发之导入Charts与饼图

iOS开发之导入Charts与饼图

作者: Ego_1973 | 来源:发表于2017-06-07 19:02 被阅读0次

(开个小差....)
html有http://echarts.baidu.com/examples.html源码来参考
我们iOS也有https://github.com/danielgindi/Charts 这个呀
源码是swift,对于现在把OC作为主程的我还是需要桥接文件这些东西的,那我们就开始吧😄

Simona_Test1.png
Simona_Test2.png Simona_Test3
创建好后当前文件夹下会出现红框内两个文件
Simona_Test4.png
在build setting里搜索 defines module 并设置成Yes
Simona_Test5.png
下载https://github.com/danielgindi/Charts 
现在将箭头指向的  ##Charts.xcodeproj   直接拖到自己的工程中
Simona_Test6.png
拖好的样子
Simona_Test7.png
导入静态库
Simona_Test8.png
Simona_Test9.png
引入Charts
Simona_Test9.png
#import "Charts/Charts.h"
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

BarChartView *chatView = [[BarChartView alloc] initWithFrame:CGRectMake(5, 5, [UIScreen mainScreen].bounds.size.width - 10, [UIScreen mainScreen].bounds.size.height - 10)];
[self.view addSubview:chatView];
   }
Simona_Test10.png
  Run  出现如图所示就ok拉
Simona_Test11.png

2017-06-09更新------
真机测试时可能会出现Reason: image not found

Simona_Test1.png Simona_Test2.png Simona_Test3 Simona_Test4.png Simona_Test5.png

再运行就可以了

相关文章

网友评论

    本文标题:iOS开发之导入Charts与饼图

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