buttons for plot

This commit is contained in:
Sergey Solovyev 2012-01-22 22:49:36 +04:00
parent 8070381db4
commit 3562bd6c61

View File

@ -21,7 +21,7 @@ import jscl.math.function.Constant;
import jscl.text.ParseException;
import org.achartengine.ChartFactory;
import org.achartengine.GraphicalView;
import org.achartengine.chart.LineChart;
import org.achartengine.chart.CubicLineChart;
import org.achartengine.chart.PointStyle;
import org.achartengine.chart.XYChart;
import org.achartengine.model.XYMultipleSeriesDataset;
@ -46,6 +46,8 @@ import java.io.Serializable;
*/
public class CalculatorPlotActivity extends Activity {
private static final String TAG = CalculatorPlotActivity.class.getSimpleName();
private static final int DEFAULT_NUMBER_OF_STEPS = 100;
private static final int DEFAULT_MIN_NUMBER = -10;
@ -160,6 +162,7 @@ public class CalculatorPlotActivity extends Activity {
graphicalView.addPanListener(new PanListener() {
@Override
public void panApplied() {
Log.d(TAG, "org.achartengine.tools.PanListener.panApplied");
updateDataSets(chart);
}
@ -182,6 +185,9 @@ public class CalculatorPlotActivity extends Activity {
synchronized (pendingOperation) {
//lock all operations with history
if (pendingOperation.getObject() == this) {
Log.d(TAG, "org.solovyev.android.calculator.plot.CalculatorPlotActivity.updateDataSets");
final XYMultipleSeriesRenderer dr = chart.getRenderer();
//Log.d(CalculatorPlotActivity.class.getName(), "x = [" + dr.getXAxisMin() + ", " + dr.getXAxisMax() + "], y = [" + dr.getYAxisMin() + ", " + dr.getYAxisMax() + "]");
@ -259,7 +265,7 @@ public class CalculatorPlotActivity extends Activity {
renderer.addSeriesRenderer(createImagRenderer());
}
return new LineChart(data, renderer);
return new CubicLineChart(data, renderer, 0.1f);
}
private static XYSeriesRenderer createImagRenderer() {