iOS-Charts
今天一时兴起给大家介绍一个好用的数据图开源库:iOS-Charts
,github链接https://github.com/danielgindi/Charts,这个开源库是用Swift实现的,作者相当🐂,这个项目有9435
个Star,Android也有他写的相应开源库:MPAndroidChart
。 本博客原文地址
http://lvesli.com/2016/06/06/iOS-Charts/













进店须知
先上几个美图,给大家个视觉感受,看看是不是你的菜,现在毕竟是看脸的时代。然后我再介绍她能提供哪些“特殊服务”。如果你满意接下来再具体给你介绍如何把“她”抱回家(具体配置和使用)。
店长介绍
看完艳压群芳、技压群芳
的姑凉们,如果感觉还不错,接下来听我具体介绍本店的"特殊服务"。本店特色、店长推荐,免除你独自撸码实现的烦恼。
- 可以实现8各不同类型的数据图
- 支持图形缩放(使用你勤劳的手指双击或者双指撑开)
- 支持拖拽和滑动
- 双轴线
- 自定义x轴或者y轴
- 高亮数据(自定义 popup-views)
- 以PNG、JPEG格式保存到相册
- 预定义颜色模板
- 图例(自动生成或者自定义)
- 动画(支持x轴和y轴动画)
- 限制线(用于显示添加限制信息或者最大值)
- 自定义(绘制、类型面板、图例、颜色、背景、手势、虚线)
- 绘制来自Realm.io移动数据库的数据
能看到这说明你也是一个痴情郎啊,既然选择就一往情深。下面看看如何带回家享受服务吧。
缴费办理
一、 手动配置
- 把
Charts.xcodeproj
拖拽到你的工程 - 打开
target's settings
,点击Embedded Binaries
下方的加号,选择Charts.framework
- Xcode 6.3.1 有一个bug,你必须先编译然后引入头文件
- @import Charts
- 在Objc项目中需要添加桥接文件
一、 使用Pods
1.在Podfile
文件中添加
pod 'Charts/Realm'
执行 pod install
命令
售后服务
iOS-Charts
已经能够实现大部分功能,当然由于业务需求,她不能完全满足你的需求,就需要你改源码了。比如我司业务还需要她满足一下功能:
- 数据点只支持圆点不支持正方形。
- 多条折线时无法同时高亮相同X轴的点
- 柱状图动画不支持数值变换
下一篇文章我会讲解如何在GitHub上Fork iOS-Charts的代码、修改源码满足自己的业务需求。
看到这,你才是“本店”的忠实粉丝啊,看在我们“优质的服务和合理的价格”,欢迎分享到朋友圈,未关注用户点击右上角关注哟。
更多精彩文章请浏览我的博客:http://lvesli.com,本博客发布也会在 *** lecoding *** 微信公众号中同步更新,欢迎大家订阅,有什么问题可以在此一起交流。公众号搜索:*** 乐Coding *** 或者 *** lecoding *** 或者微信扫描下方二维码:
