TWRCharts实现动画图表
来源:互联网 发布:请州长夫人演唱 知乎 编辑:程序博客网 时间:2024/04/30 08:47
导入TWRCharts
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
-(void)loadBarChart;
@end
#import "ViewController.h"
#import "TWRChart.h"
//16进制色值
#define HEXCOLOR(c) [UIColor colorWithRed:((c>>16)&0xFF)/255.0 green:((c>>8)&0xFF)/255.0 blue:(c&0xFF)/255.0 alpha:1.0]
@interface ViewController ()
@property(strong, nonatomic)TWRChartView *chartView;
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *jsFilePath = [[NSBundlemainBundle] pathForResource:@"index"ofType:@"js"];
_chartView = [[TWRChartViewalloc]initWithFrame:CGRectMake(0,104,[[UIScreenmainScreen] bounds].size.width,276)];
[_chartView setChartJsFilePath:jsFilePath];
_chartView.backgroundColor = [UIColorwhiteColor];
[self.viewaddSubview:_chartView];
[selfloadBarChart];
}
-(void)loadBarChart
{
NSArray *array1 = @[@"121", @"11", @"8"];
NSArray *array2 = @[@"44", @"31", @"22"];
NSArray *array3 = @[@"8", @"32", @"55"];
TWRDataSet *dataSet1 = [[TWRDataSetalloc] initWithDataPoints:array2
fillColor:[HEXCOLOR(0xf13c3d)colorWithAlphaComponent:0.5]
strokeColor:[UIColor clearColor]];
TWRDataSet *dataSet2 = [[TWRDataSetalloc] initWithDataPoints:array1
fillColor:[HEXCOLOR(0xffb633) colorWithAlphaComponent:0.5]
strokeColor:[UIColor clearColor]];
// NSArray *labels = @[@"A", @"B", @"C", @"D", @"E",@"F"];
TWRBarChart *bar = [[TWRBarChartalloc] initWithLabels:array3
dataSets:@[dataSet1,dataSet2]
animated:YES];
// Load data
[_chartViewloadBarChart:bar withCompletionHandler:^(BOOL finished) {
}];
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
- TWRCharts实现动画图表
- fusioncharts实现数据动画图表
- XAML 图表动画
- fusioncharts动画图表
- 图表实现
- C#实现数据图表
- FLEX3D图表旋转实现
- android图表的实现
- echarts实现统计图表
- android炫酷动画柱状图表例子
- JS插件实现图表显示(曲线图表、柱形图表、饼状图表)
- JS插件实现图表显示(曲线图表、柱形图表、饼状图表)
- ASP.NET实现数据图表
- ASP.NET实现数据图表
- ASP.NET实现数据图表
- 用 dotnetCHARTING 实现图表功能
- 用 BIRT 实现高级图表
- 实现数据的图表统计
- Source Insight如何改变背景颜色
- NameNode之文件系统目录树
- 24on物流链WMS仓库条码管理系统在企业对仓库的重要意义
- yum install ansible无法直接安装Ansible的解决方法
- 软件测试过程模型特点(V模型 W模型 X模型 H模型)
- TWRCharts实现动画图表
- 为什么版本控制器我坚持使用VSS
- 为何Z81DA安全芯片能应用到设备认证和配件认证领域,物联网安全芯片
- Linux的基本操作
- gui扯:阿里云专有云、超融合、AWS以及张北二期
- MQTT入门
- 史上最LOW的PHP连接池解决方案
- 【区块链】区块链平台调研与分析报告
- JavaScript中window.location.hash属性介绍