Tuesday, 15 July 2014

android - graphview unable to zoom -



android - graphview unable to zoom -

following simple sine wave graph display. want zoom in , out using pinch zoom gesture.

info = new graphviewdata[num]; double v=0; (int i=0; i<num; i++) { v = 2*math.pi*30*i; data[i] = new graphviewdata(i, math.sin(v/num)); } graphview = new linegraphview(this, "graphviewdemo"); // add together info graphview.addseries(new graphviewseries(data)); // set view port, here num = 256 graphview.setviewport(0, num-1); graphview.setscrollable(true); linearlayout layout = (linearlayout) findviewbyid(r.id.graph1); layout.addview(graphview);

is there property enabled utilize zoom feature, or should implement setviewport() manually , handle zoom feature?

graphview.setscalable(true);

add line zooming graph.

android android-graphview

No comments:

Post a Comment