iOS 对折线图的封装

1.  DrawScrollView.h

 //  Created by yinbo on 2016/11/10.//  Copyright © 2016年 yinbo. All rights reserved.//#import@interface DrawScrollView : UIView

-(void)setHorizontalArr:(NSArray *)hArr withVerticalArr:(NSArray *)vArr withHorWidth:(float)hwidth withHorHigth:(float)horhigth withVertical:(float)vwidth  withdataArr:(NSArray *)dataArr ;//harr横坐标集合,varr竖坐标集合,hwidth横向每项宽度,horhigth横向每项的高度,vwidth竖向每项的宽度,dataArr数组集

//harr横坐标集合,varr竖坐标集合,hwidth横向每项宽度,horhigth横向每项的高度,vwidth竖向每项的宽度,dataArr数组集

-(void)setHorizontalArr:(NSArray *)hArr withVerticalArr:(NSArray *)vArr withHorWidth:(float)hwidth withHorHigth:(float)horhigth withVertical:(float)vwidth  withdataArr:(NSArray *)dataArr withZwidth:(float)zwidth;

@property(nonatomic,strong)NSArray *harr;

@property(nonatomic,strong)NSArray *varr;

@property(nonatomic,assign)float hwidth;

@property(nonatomic,assign)float horhigth;

@property(nonatomic,assign)float vwidth;

@property(nonatomic,assign)float zwidth;

@property(nonatomic,assign)BOOL isLine;

@property(nonatomic,strong)NSArray *dataArr;

@end


2.DrawScrollView.m

//

//  DrawScrollView.m


//

//  Created by yinbo on 2016/11/10.

//  Copyright © 2016年 yinbo. All rights reserved.

//

#import "DrawScrollView.h"

@implementation DrawScrollView

-(id)initWithFrame:(CGRect)frame{

self=[super initWithFrame:frame];

return  self;

}

-(void)setHorizontalArr:(NSArray *)hArr withVerticalArr:(NSArray *)vArr withHorWidth:(float)hwidth withHorHigth:(float)horhigth withVertical:(float)vwidth  withdataArr:(NSArray *)dataArr {

_harr=hArr;

_varr=vArr;

_hwidth=hwidth;

_horhigth=horhigth;

_vwidth=vwidth;

_dataArr=dataArr;

_isLine=YES;

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容