Search code examples
androidgraphandroid-graphview

Trying to add date in axis X - GraphView for android


I need some help, I want to show in my GraphView date by DD/MM/YYYY in axis x. And in the y axis number(Integer)... how can I add the date to the axis X it only get int. (I use this library http://android-graphview.org/ )


Solution

  • You can use a custom list of horizontal labels, like this:

    barGraphView.setHorizontalLabels(new String[]{"1/1/1970", "1/2/1970", "1/3/1970"});
    

    I did something similar by constructing the String array using a for-loop.