java - Cursor SQLite with AndroidPlot -
i want connect sqlite cursor androidplot error. code, 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 , 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 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)'
there no constructor simplexyseries
can pass cursor
object to. signature of constructor:
simplexyseries(list<? extends number> model, simplexyseries.arrayformat format, string title)
so need transform cursor
list
of numbers or data type inherits number
. have @ this post on how create list
cursor
.
Comments
Post a Comment