I have a date-based graph with x-axis as dates. By default, I populate the graph with a data set of past 6 months. I would like to change the graph to show:
- Last one week,
- Last one month,
- Last 3 months etc.
I looked at the API documentation for modifying the viewport here: https://github.com/PhilJay/MPAndroidChart/wiki/Modifying-the-Viewport
And tried playing around with:
graph.setVisibleXRangeMaximum(100);
graph.moveViewToX(50);
graph.invalidate();
I tried various different parameters, but nothing happens when the above code is executed. My graph already has data filled and is displaying correctly.
Am I looking in the right direction for what I want to achieve? How can I debug my issue?