// // IfishChatView.m // Ifish // // Created by 罗艺 on 2018/8/27. // Copyright © 2018年 lianlian. All rights reserved. // #import "IfishChatView.h" #import "IfishHistroyVo.h" @interface IfishChatView() @property(nonatomic,strong)NSMutableArray*line1; @property(nonatomic,strong)NSMutableArray*line2; @property(nonatomic,strong)UIView *lablesView; @property(nonatomic,strong)UILabel*numLable; @end @implementation IfishChatView -(UILabel *)numLable{ if (_numLable==nil) { _numLable=[[UILabel alloc]init]; [self addSubview:_numLable]; } return _numLable; } -(UIView *)lablesView{ if (_lablesView==nil) { _lablesView=[[UIView alloc]init]; _lablesView.frame=CGRectMake(290, 0, 28, 190); _lablesView.backgroundColor=[UIColor clearColor]; [self addSubview:_lablesView]; } return _lablesView; } -(NSArray *)line1{ if (_line1==nil) { _line1=[NSMutableArray array]; } [_line1 removeAllObjects]; if (_datas.count) { NSSortDescriptor *ageSD = [NSSortDescriptor sortDescriptorWithKey:@"heaterGatheringTime_int" ascending:YES]; self.datas = [self.datas sortedArrayUsingDescriptors:@[ageSD]]; // CGFloat gapW= 357*scale*0.1; for (int i=0; i350){ vo.heaterWaterTemperature=@"350"; }else if(vo.heaterWaterTemperature.integerValue<250){ continue; } CGFloat y=188*(1-((vo.heaterWaterTemperature.integerValue*0.1-25)/10))+36.5;//*-1*+158; CGPoint p1=CGPointMake(x, y); // NSLog(@"%f-------%f--%f-",y,vo.heaterWaterTemperature.integerValue*0.1,x); [_line1 addObject:NSStringFromCGPoint(p1)]; } } return _line1; } -(NSArray *)line2{ if (_line2==nil) { _line2=[NSMutableArray array]; } if (_datas.count) { NSSortDescriptor *PhSD = [NSSortDescriptor sortDescriptorWithKey:@"heaterPh_int" ascending:YES]; NSMutableArray*arr = [[self.datas sortedArrayUsingDescriptors:@[PhSD]] mutableCopy]; IfishHistroyVo*vo=arr[0]; NSInteger miniPh=vo.heaterPh_int-50; IfishHistroyVo*vo1=arr[arr.count-1]; NSInteger maxPh=vo1.heaterPh_int+50; NSInteger range=maxPh-miniPh; [_line2 removeAllObjects]; for (int i=0; i