I am using "achartengine" in android for chart, in that I want points on Y-axis as 0,0.5,1.0,1.5 instead of 0,1,2,3,4.
What can I do?
You can tweak the value you set using renderer.setYLabels() until it displays what you need.
Or you can add custom labels:
renderer.addYTextLabel(0.5, "0.5");
Related
Below is the chart I am trying to create using MPAndroidChart library:
required_graph
To create this graph, I need some way to tell the linechart to only show two y-values "Average" and "You". I also need a way to draw a vertical grid-line that only goes up to the circle/y-value. I have searched for tutorials, SO articles, issues on MPAndroidChart github as well as the wiki, but I'm still uncertain how to create the graph above. Is there a way to create this graph with MPAndroidChart? Any help is much appreciated.
Try creating multiple data sets and style them differently. The 1st one should contain all the values, including "Average" and "You", enable fill color and disable drawing the circles.
Then, create a new set with a single value (average) and give it a different style. Do the same with the "you" value.
Good luck !
I am using MPAndroidChart, I want to use
setDrawCircles(true);
setDrawValues(true);
only for selected value from line chart in mpchart libary. Means I do not want to draw label and circle on whole data set which can be easily achieved using above methods. I need to draw label and circle only for one value from chart. I have implemented onChartValueSelected and I do not know what should be done in onValueSelected I have tried many things. I achieved this in version 2.5.5 but now I am using version 3.0.0 and facing issue.
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:
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.
// 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);
Refer this:
http://wptrafficanalyzer.in/blog/android-drawing-line-chart-using-achartengine/
for smooth curve lines please refer this:
How to make line with rounded (smooth) corners with AndroidPlot
Hope this may help you.
AChartEngine is a charting library for Android applications. Using AChartEngine library, we can plot various charts like line chart, area chart, pie chart, time chart, bubble chart etc.
i am using AChartEngine library for android and i am drawing a chart using SalesComparisonChart class. but i noticed that the lines drawn does not reach the same value in number, it is drawn below the exact value like below in the photo . in category Oriental the value is 3608 and 4358 but the lines are below those values. Can someone help me ?
Please create an issue in the AChartEngine issue tracker.
Until this will be fixed you can use LineChart instead of the cubic line chart or you can add custom annotations.
series.addAnnotation("text", x, y);
I'm using achartengine to show a temperature graph. on X axis I put dates, to fit them I call setXLabelsAngle(45); this is the result:
As you can see, the labels are placed too high and go over the x-Axis. How could I fix this? I'm already using setMargins(), but labels don't move, only legend does.
This will help:
renderer.setXLabelsAlign(Align.LEFT);