dataset - MPAndroidchart returning no chart Data available -
i having problems mpandroidchart. adding temperature , humidity data chart, displays "no chart data available". here can see bug is? super grateful!
//create data //set size of data int size = list.size(); if (size > 24){ size = 24;} //create lists form temp , hum arraylist<entry> temps = new arraylist<entry>(); arraylist<entry> hums = new arraylist<entry>(); //fill list temp values (int = 0; < size; i++){ entry value = new entry(math.round(list.get(list.size()-size + i).temp), (size-i)); temps.add(value); } //fill list hum values (int = 0; < size; i++){ entry value = new entry(math.round(list.get(list.size()-size + i).hum), (size-i)); hums.add(value); } //other views on screen date.settext(datestring); time.settext(timestring); temp.settext(tempstring); hum.settext(humstring); //adding data , description array linedataset settemp = new linedataset(temps, "temperature"); settemp.setaxisdependency(yaxis.axisdependency.left); linedataset sethum = new linedataset(hums, "humidity"); sethum.setaxisdependency(yaxis.axisdependency.left); //adding arrays dataset arraylist<ilinedataset> datasets = new arraylist<ilinedataset>(); datasets.add(settemp); datasets.add(sethum); arraylist<string> xvals = new arraylist<string>(); //adding x values of range size (int = 0; < size; i++ ){ xvals.add(string.valueof(i)); } //add data , create chart linedata data = new linedata(xvals, datasets); chart.setdata(data); chart.invalidate(); } });
i looking @ post long time. thing can think line:
math.round(list.get(list.size()-size + i).hum
what's .hum
? generate unsupported type entry? resolution issue intrigues me since mr. phil j. did not found answer yet.
Comments
Post a Comment