Monday 15 June 2015

ios - Assertation Failure in CorePlot -



ios - Assertation Failure in CorePlot -

i have started testing application on iphone 6 plus , when selecting info point using coreplot graph drew, error messages such following:

assertion failure in -[cptxyplotspace setyrange:], /users/joshhamet/downloads/core-plot-release_1.5.1/framework/source/cptxyplotspace.m:416

however works iphone 5 fine, curious if explain how prepare this. here's code. thanks!

-(void)scatterplot:(cptscatterplot *)plot plotsymbolwasselectedatrecordindex:(nsuinteger)idx { /*set index selected , phone call graph redrawn selected symbol red*/ self.indexselected=idx; [self.graph reloaddata]; cptplotrange *newxrange=[cptplotrange new]; /*if have daily graph, need calculate x coordinate ourselves*/ if([self.graphtitle isequaltostring:@"daily"]){ double location=[[self xindexfordailygraph:idx]doublevalue]-1; if(location<=0) newxrange=[cptplotrange plotrangewithlocation:cptdecimalfromint(0) length:cptdecimalfromdouble(2)]; else newxrange=[cptplotrange plotrangewithlocation:cptdecimalfromdouble(location) length:cptdecimalfromdouble(2)]; } /*monthly , weekly graphs x coordinate*/ else{ if(!idx){ newxrange=[cptplotrange plotrangewithlocation:cptdecimalfromdouble(idx) length:cptdecimalfromdouble(2)]; } else{ newxrange=[cptplotrange plotrangewithlocation:cptdecimalfromdouble(idx-1) length:cptdecimalfromdouble(2)]; } } /*determine y index of index (depends on current day or month)*/ if([self.graphtitle isequaltostring:@"weekly"]){ nsinteger weekday=[[nscalendar currentcalendar]component:nscalendarunitweekday fromdate:[nsdate date]]; idx=(weekday+idx)%7; } if([self.graphtitle isequaltostring:@"monthly"]){ nsinteger currentmonth=[[nscalendar currentcalendar]component:nscalendarunitmonth fromdate:[nsdate date]]; idx=(currentmonth+idx)%12; } double selectedpoint=[[self.urinationdataarray[idx] objectforkey:@"amountofurine"]doublevalue]; cptplotrange *newyrange=[cptplotrange plotrangewithlocation:cptdecimalfromint(selectedpoint-10) length:cptdecimalfromdouble(20)]; [cptanimation animate:self.plotspace property:@"xrange" fromplotrange:self.plotspace.xrange toplotrange:newxrange duration:.1 animationcurve:cptanimationcurvecubicinout delegate:self]; [cptanimation animate:self.plotspace property:@"yrange" fromplotrange:self.plotspace.yrange toplotrange:newyrange duration:.1 animationcurve:cptanimationcurvecubicinout delegate:self]; /*add text annotation*/ [self addannotationatrecordindex:idx forplot:plot]; }

this bug in core plot. believe has been fixed in latest code on github. you'll need pull latest code , build core plot source. @ change log see has changed since 1.5.1.

ios core-plot

No comments:

Post a Comment