I want to connect SQLite cursor with AndroidPlot but I get error. This is my code, what would be the error?
private XYPlot mySimpleXYPlot;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_grafica);
// initialize XYPlot reference:
mySimpleXYPlot = (XYPlot) findViewById(R.id.mySimpleXYPlot);
//increment Domain and Range
mySimpleXYPlot.setDomainStep(XYStepMode.INCREMENT_BY_VAL,0.05);
mySimpleXYPlot.setRangeStep(XYStepMode.INCREMENT_BY_VAL,0.05);
//Open database PlotXY
DatabaseHelper admin_PlotXY = new DatabaseHelper(this);
SQLiteDatabase bd_PlotXY = admin_PlotXY.getWritableDatabase();
//Cursor SQLite PlotXY
Cursor data_PlotXY = bd_PlotXY.rawQuery(
"select xi,yi from plot_xy", null);
if (data_PlotXY.moveToFirst()) {
XYSeries serie_xy = new SimpleXYSeries(data_PlotXY, SimpleXYSeries.ArrayFormat.XY_VALS_INTERLEAVED, "Series X=Y");
LineAndPointFormatter seriesFormatXY = new LineAndPointFormatter(Color.rgb(127, 255, 0),0x000000,0x000000,null);
mySimpleXYPlot.clear();
mySimpleXYPlot.addSeries(serie_xy,seriesFormatXY);
mySimpleXYPlot.redraw();
}
else{
Toast.makeText(this, "Error en la Base de Datos plot_xy", Toast.LENGTH_SHORT).show();}
data_PlotXY.close();
}`
the message: "Cannot resolve constructor 'SimpleXYSeries(android.databaseCursor,androidplot.xy.SimpleXYSeries.ArrayFormat,Java.lang.String)'