第九天 iOS 绘图
2016-06-04 20:08
295 查看
开源库 ios-charts
https://github.com/danielgindi/ios-charts https://github.com/PhilJay/MPAndroidChart
使用
iOS 8 以上可直接用pods安装。$ pod search charts -> CSChartsView (0.1.0) A light weight line graph drawing framework pod 'CSChartsView', '~> 0.1.0' - Homepage: https://github.com/sk344208651/CSChartsView - Source: https://github.com/sk344208651/CSChartsView.git - Versions: 0.1.0 [master repo] -> Charts (2.1.0) ios-charts is a powerful & easy to use chart library for iOS pod 'Charts', '~> 2.1.0' - Homepage: https://github.com/danielgindi/ios-charts - Source: https://github.com/danielgindi/ios-charts.git - Versions: 2.1.0, 2.0.9 [master repo]
iOS 7 拖动所有.swift到xcode工程中。
If you want to compile for iOS 7:
Drag the code itself (.swift files) to your project. As sadly, Swift currently does not support compiling Frameworks for iOS 7.
Make sure that the files are added to the Target membership.
When using Swift in an ObjC project: a. You need to import your Bridging Header. Usually it is “YourProject-Swift.h”, so in ChartsDemo it’s “ChartsDemo-Swift.h”. Do not try to actually include “ChartsDemo-Swift.h” in your project :-) a. Under “Build
Options”, mark “Embedded Content Contains Swift Code”
Features 特征
Core features:
8 different chart typesScaling on both axes (with touch-gesture, axes separately or pinch-zoom)
Dragging / Panning (with touch-gesture)
Combined-Charts (line-, bar-, scatter-, candle-stick-, bubble-)
Dual (separate) Y-Axis
Finger drawing (draw values into the chart with touch-gesture)
Highlighting values (with customizeable popup-views)
Multiple / Separate Axes
Save chart to camera-roll / export to PNG/JPEG
Predefined color templates
Legends (generated automatically, customizeable)
Customizeable Axes (both x- and y-axis)
Animations (build up animations, on both x- and y-axis)
Limit lines (providing additional information, maximums, …)
Fully customizeable (paints, typefaces, legends, colors, background, gestures, dashed lines, …)
Screenshots
creenshots are currently taken from the original repository, as they render exactly the same :-)LineChart (with legend, simple design)
LineChart (with legend, simple design)
LineChart (cubic lines)
LineChart (single DataSet)
Combined-Chart (bar- and linechart in this case)
BarChart (with legend, simple design)
BarChart (grouped DataSets)
Horizontal-BarChart
PieChart (with selection, …)
ScatterChart (with squares, triangles, circles, … and more)
CandleStickChart (for financial data)
BubbleChart (area covered by bubbles indicates the value)
RadarChart (spider web chart)
Documentation
Currently there’s no need for documentation for the iOS version, as the API is 95% the same as on Android.You can read the official MPAndroidChart documentation here: Wiki
Or you can see the ChartsDemo project and learn the how-tos from it.
相关文章推荐
- iOS 多线程处理 ----NSThread, NSOperation,GCD
- iOS开发中经常用到的细节
- iOS高级开发实战技巧讲解
- iOS中按钮根据tag来区分
- iOS 将字典 数组 转换成 NSdata 或者 NSString
- 写单例,看完这个就够了
- iOS--轮播视图
- 【iOS开发】提交构建版本出错:ERROR ITMS-90635
- OC&&IOS开发小技巧总结
- iOS 多线程 GCD
- iOS View的Frame和bounds之区别,setbounds使用
- IOS infoplist介绍
- IOS(sandbox)沙盒和文件操作(NSFileManager)
- 【51CTO学院三周年】没妹子 没票子 iOS大神之路
- [修正] Berlin 10.1 支持 iPhone 4 (iOS v7.x)
- 【iOS开发】隐藏键盘
- IOS 响应者链条
- iOS点击事件重复执行(取消延迟执行函数)
- iOS使用自定义字体
- IOS 委托代理(delegate)实现页面传值