Reputation: 1506
Following is a simple sine wave graph display. I want to zoom in and out using pinch zoom gesture.
data = new GraphViewData[num];
double v=0;
for (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 data
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 any property to be enabled to use zoom feature, or should i implement setViewPort() manually and handle zoom feature?
Upvotes: 1
Views: 1881