LineChart issue using MPAndroidChart library

KplMax picture KplMax · Aug 21, 2014 · Viewed 12.3k times · Source

I am trying to make a simple smooth line chart which show the X axis as date-time on bottom and Y axis as normal left side. I just started using MPAndroidChart API and its example app in Git. In the example Line chart I am not able to find option to change X axis labels to show on bottom instead of top as show currently.

Just like:

enter image description here

Also is there a way to handle date-time data for X axis values ?

Also I tried my hand on Androidplot API but to make the line smooth there I need to make changes in library code which is not compiling at all in my Eclipse and giving errors. Also in Androidplot I did not find an option to show popup with data once I click on line chart.

So if anyone know how to make a smooth line chart using Androidplot API without modifying its library code and how to bring small popup with data in Androidplot API please reply.

Answer

lipel picture lipel · Mar 16, 2016
// XAxis settings
graph.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
graph.getXAxis().setLabelsToSkip(0);

// and
// make the line smooth
graph.getLineData().getDataSets().get(0).lineDataSet.setDrawCubic(true);