Android GraphView library - Scale and Scroll doesn't work on little X Date increments (seconds) -
i'm using graphview library (see: https://github.com/jjoe64/graphview or http://www.jjoe64.com/p/graphview-library.html). working graphview-demos-master, modify "public class dateasxaxis .." little increments in date seconds , not day increments. seconds increments in x axis, scale , scrolls doesn't function.
calendar calendar = calendar.getinstance(); date d1 = calendar.gettime(); datapoint[] datos = new datapoint[50]; (int i=0; i<50; i++){ datos[i]= new datapoint(d1,i%4); // d1.settime(d1.gettime() + 86400000); // 1 day works ok, jumps in scale d1.settime(d1.gettime() + 60000); // 1 min doesn't work scrolling not scaling. } linegraphseries<datapoint> series = new linegraphseries<datapoint>(datos); graph.addseries(series); // set date label formatter graph.getgridlabelrenderer().setlabelformatter(new dateasxaxislabelformatter(getactivity())); graph.getgridlabelrenderer().setnumhorizontallabels(3); // 4 because of space // set manual x bounds have nice steps graph.getviewport().setminx(datos[0].getx()); graph.getviewport().setmaxx(datos[3].getx()); graph.getviewport().setxaxisboundsmanual(true); graph.getviewport().setscalable(true);
Comments
Post a Comment