ios6 - core-plot Mixing CPTScatterPlotInterpolationCurved and CPTScatterPlotInterpolationLinear -


i need able draw sequential line segments have same y coordinate cptscatterplotinterpolationlinear , ones not cptscatterplotinterpolationcurved. cptscatterplotinterpolationcurved draws lines curved. doing adding multiple plots.

public list<correctedgraphpoints> getcorrectdatapoints(list<pointf> datasource)         {             int lastindex = 0;             bool shouldloop = true;             cptscatterplotinterpolation interpolation = cptscatterplotinterpolation.curved;             list<correctedgraphpoints> outerlist = new list<correctedgraphpoints> ();              if (datasource [0].y == datasource [1].y)                 interpolation = cptscatterplotinterpolation.linear;              while (lastindex+1 != datasource.count) {                 outerlist.add (new correctedgraphpoints (interpolation));                  while (shouldloop)                  {                      outerlist[outerlist.count -1].add(datasource[lastindex]);                     if ((lastindex + 1) < datasource.count) {                         if (interpolation == cptscatterplotinterpolation.linear) {                             if (datasource [lastindex].y != datasource [lastindex + 1].y) {                                 interpolation = cptscatterplotinterpolation.curved;                                 shouldloop = false;                                 break;                             }                         }                          if (interpolation == cptscatterplotinterpolation.curved) {                             if (datasource [lastindex].y == datasource [lastindex + 1].y) {                                 interpolation = cptscatterplotinterpolation.linear;                                 shouldloop = false;                                 break;                             }                         }                     }                      else {                         shouldloop = false;                         break;                     }                      if (shouldloop)                         lastindex++;                 }                  shouldloop = true;             }              return outerlist;           }    public class correctedgraphpoints     {         private list<pointf> points;         public list<pointf> points { { return points; } }          private cptscatterplotinterpolation interpolation;         public cptscatterplotinterpolation interpolation { { return interpolation; } }           public correctedgraphpoints(cptscatterplotinterpolation interpolation)         {             this.interpolation = interpolation;             points = new list<pointf> ();         }          public void add(pointf point)         {             points.add (point);         }     } 

however creating multiple plots use fill slows app down tremendously. wondering if limit how this? haven't been able find way change interpolation section?? issue core plot or wrong logic or code?

another possible solution add additional points data draw curved sections. allow use 1 plot. number of additional points needed depend on several factors including size of plot , line style used draw line.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -