功能分类:其他
支持平台:iOS
运行环境:iOS
开发语言:Object-c
开发工具:Xcode
源码大小:84.80KB
源码下载地址:http://down.51cto.com/data/1982906
源码简介
用Swift语言开发的一个简单易用的漂亮图表库,需要苹果框架:Foundation.framework,UIKit.framework,CoreGraphics.framework,QuartzCore.framework
请根据自己的Xcode修改部分swift代码~
源码运行截图
运行图
源码片段
- func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) {
- var viewCon: UIViewController = UIViewController()
- viewCon.view.backgroundColor = UIColor.whiteColor()
- var chart: PDChart!
- switch indexPath.row {
- case 0:
- var lineChart: PDLineChart = self.getLineChart()
- chart = lineChart
- viewCon.view.addSubview(lineChart)
- case 1:
- var pieChart: PDPieChart = self.getPieChart()
- chart = pieChart
- viewCon.view.addSubview(pieChart)
- case 2:
- var barChart: PDBarChart = self.getBarChart()
- chart = barChart
- viewCon.view.addSubview(barChart)
- default:
- break
- }
- chart.strokeChart()
- self.navigationController.pushViewController(viewCon, animated: true)
- }