android - MPAndroidChart: Bar Chart variables X entries -


i have added mpandroidchart project code , use bar chart x-entires want enter start date , end date variables.

please how can ?

finally found solution not totaly good:

i have modify public class dayaxisvalueformatter below:

private barlinechartbase<?> chart; private string[] mvalues; private arraylist<long> mdatelist = new arraylist<long>(); private int msize;  public dayaxisvalueformatter(barlinechartbase<?> chart, arraylist<long> datelist, int size) {     this.chart = chart;     this.mdatelist = datelist;     this.msize = size; }  @override public string getformattedvalue(float value, axisbase axis) {      // "value" represents position of label on axis (x or y)     return longtostringfortimereal(mdatelist.get( msize)); }  //pour le formatage de la date  public static string longtostringfortimereal(long time) {     date date = new date(time);     simpledateformat simpledate = new simpledateformat("yyyy/mm/dd");     return simpledate.format(date); } 

and call this:

axisvalueformatter xaxisformatter = new dayaxisvalueformatter(mchart,mdatelist, mdatelist.size()); xaxis.setvalueformatter(xaxisformatter); 

the issue method is: got same date on x values.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -