LineChart problem using MPAndroidChart library

I am trying to make a simple smooth line chart that shows the X-axis as datetime at the bottom and the Y-axis as the normal left side. I just started using the MPAndroidChart API and sample app in Git. In the Line Chart example, I can't seem to find an option to change the X-axis labels to show from the bottom rather than the top as currently shown.

As well as:

enter image description here

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

Also, I tried my hand at Androidplot API, but to make the line smooth I need to make changes to the library code, which doesn't compile in my Eclipse at all and doesn't give errors. Also in Androidplot I have not found the option to display data popups when I click on the line chart.

So, if anyone knows how to make a sleek line chart using Androidplot API without changing its library code and how to bring a small data popup to Androidplot API, please respond.

+3


source to share


2 answers


// 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);

      



+2


source


Please note: http://wptrafficanalyzer.in/blog/android-drawing-line-chart-using-achartengine/

for smooth curve lines see this:

How to make a line with rounded (smooth) corners with AndroidPlot



Hope this can help you.

AChartEngine is a graphics library for Android applications. Using AChartEngine library , we can display various charts such as line chart, area chart, pie chart, timeline, bubble chart, etc.

-2


source







All Articles