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橫坐標(biāo)集合,varr豎坐標(biāo)集合,hwidth橫向每項(xiàng)寬度,horhigth橫向每項(xiàng)的高度,vwidth豎向每項(xiàng)的寬度,dataArr數(shù)組集

//harr橫坐標(biāo)集合,varr豎坐標(biāo)集合,hwidth橫向每項(xiàng)寬度,horhigth橫向每項(xiàng)的高度,vwidth豎向每項(xiàng)的寬度,dataArr數(shù)組集

-(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;

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容