android - PhilJay/MPAndroidChart ploting server date in LineChart -
i trying plot data server in linechart
i tried converting server date long
i not able show proper plotting.
data server
{ "status_code": 200, "status": "success", "response": { "wws_level": 1, "current": 2.1, "target": 66, "logs": [ { "id": "22", "stats_id": "1", "user_id": "53", "log_of_on": "2017-07-27", "log_val": "6.00", "height": "5.8", "log_date": "27 july, 2017" } ] }, "message": "" }
x-axis log_date": "27 july, 2017"
y-axis "log_val": "6.00"
my code
arraylist<entry> e1 = new arraylist<entry>(); arraylist xaxislabel; linedataset d1; (int = 1; < graphdata.size(); i++) { float x_points = float.parsefloat(graphdata.get(i).getlogval()); string y_points = graphdata.get(i).getlogdate(); e1.add(new entry(x_points, gettimestamp(y_points))); } d1 = new linedataset(e1, null); d1.setlinewidth(1.0f); d1.setcircleradius(2f); d1.setdrawvalues(true); d1.setcolor(contextcompat.getcolor(context, r.color.colorprimarydark)); d1.setcirclecolor(contextcompat.getcolor(context, r.color.colorprimarydark)); d1.setcirclecolorhole(contextcompat.getcolor(context, r.color.colorprimarydark)); d1.setdrawvalues(false); linedata linedata = new linedata(d1);
could mixing x , y values ?
string x_points = graphdata.get(i).getlogdate(); float y_points = float.parsefloat(graphdata.get(i).getlogval()); e1.add(new entry(gettimestamp(x_points), y_points));
Comments
Post a Comment