Enabled pan and zoom. Once the y axis were pinned so their origins are the same location, the pan and zoom feels better. Though there are still some bugs in there.
This commit is contained in:
parent
d1df3dd35f
commit
edcaa5d2c9
@ -95,6 +95,10 @@ public class SimulationChart {
|
|||||||
*/
|
*/
|
||||||
public Intent execute(Context context) {
|
public Intent execute(Context context) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO -
|
||||||
|
* Figure out why you can pan all over the place even where there are no visible points.
|
||||||
|
*/
|
||||||
int seriesCount = 2;
|
int seriesCount = 2;
|
||||||
// if the same series is selected twice, only plot it once.
|
// if the same series is selected twice, only plot it once.
|
||||||
if ( series1 == series2 ) {
|
if ( series1 == series2 ) {
|
||||||
@ -111,7 +115,7 @@ public class SimulationChart {
|
|||||||
renderer.setXLabels(10);
|
renderer.setXLabels(10);
|
||||||
renderer.setYLabels(10);
|
renderer.setYLabels(10);
|
||||||
renderer.setShowGrid(true);
|
renderer.setShowGrid(true);
|
||||||
//renderer.setZoomButtonsVisible(true);
|
renderer.setZoomButtonsVisible(true);
|
||||||
renderer.setChartTitle("Simulation");
|
renderer.setChartTitle("Simulation");
|
||||||
|
|
||||||
renderer.setMargins(new int[] { 50, 30, 0, 20 });
|
renderer.setMargins(new int[] { 50, 30, 0, 20 });
|
||||||
@ -122,6 +126,8 @@ public class SimulationChart {
|
|||||||
r.setPointStyle(styles[i]);
|
r.setPointStyle(styles[i]);
|
||||||
r.setFillPoints(true);
|
r.setFillPoints(true);
|
||||||
renderer.addSeriesRenderer(r);
|
renderer.addSeriesRenderer(r);
|
||||||
|
// setting the YAximMin to 0 locks the origins.
|
||||||
|
renderer.setYAxisMin(0.0, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,9 +164,7 @@ public class SimulationChart {
|
|||||||
renderer.setXAxisMax(xmax);
|
renderer.setXAxisMax(xmax);
|
||||||
renderer.setYAxisMax(ymax);
|
renderer.setYAxisMax(ymax);
|
||||||
|
|
||||||
// Don't allow pan & zoom just yet.
|
// These configurations don't really work well just now.
|
||||||
renderer.setPanEnabled(false,false);
|
|
||||||
renderer.setZoomEnabled(false,false);
|
|
||||||
//renderer.setPanLimits(new double[] { xmin, xmax, ymin, ymax });
|
//renderer.setPanLimits(new double[] { xmin, xmax, ymin, ymax });
|
||||||
//renderer.setZoomLimits(new double[] { xmin, xmax, ymin, ymax });
|
//renderer.setZoomLimits(new double[] { xmin, xmax, ymin, ymax });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user