Intersection of GridLines and line chart y-axis value - android

I am able to display the AChartEngine's TimeChartView to user, but when the graph renders, the grid lines (vertical - set by showGridLines(true)) and the line drawn on graph to display corresponding y-axis value (time in secs) against the dates on x-axis don't intersect with each other.
The y-axis value pt shows up either before the x-axis value or after it, but not exactly on it.
Please suggest, if there's any achartengine property which needs to be set to get this done / any other thing that needs to be done for getting this done.
Thanks
Omkar Ghaisas
Sample Image --
As can be seen, the points marked with ovals don't coincide with the vertical grid lines and with x axis values, but start before that. E.g the first y value for 7200 should start at vertical line of 02/03/2012, but instead starts before that. Similarly for all other data points.

This was fixed in the AChartEngine SVN.
Please see this for extra information.

Related

MPAndroid Chart GroupedBarChart center x-axis and ignore entries

I'm making a GroupedBarChart which will have three bars. The following image is a case where only 1 bar has a value.
How can I make the x-axis values line up in the middle of grouping? It seems almost centered at first and you can see it moves to the right. It gets worse as I add values.
Also, is there a way to ignore entries that have a value of 0?

MPAndroidChart : Fix x Axis width or Break X axis text in two lines

I am working and android chart library using MPAndroidChart .
I am using HorizontalBarChart to display chart.
Please see the attached image and I want do decrease x axis width or want to display x axis text in two lines is there any way to this ?
Any help will get appreciate.
There is currently no way to draw the x-axis labels in multiple lines.
What you can do to decrease the space the labels consume is to simply provide shorter labels. A axis label of the length you are showing above is too long for a chart to be easily readable anyway.

display recent plotted value on AChartEngine dynamic line graph

When I dynamically plot values I wish to display the recent plotted value on line graph (drawn with the help of AChartEngine library). In other words I wish to scroll my line graph along x-axis towards left to show the latest plotted value and hide the oldest plotted value. How to achieve this?
Whenever you add values to the datasets, if you call chartView.repaint(); the chart is updated with the new values.
In order to have the values scroll to the left, you need to change the visible area on the X axis:
renderer.setXAxisMin(theMinimumVisibleValue);
// this may be optional
// renderer.setXAxisMax(theMaximumVisibleValue);

Issues faced while drawing dynamic line graph using AChartEngine in Android

How to stop scrolling of AChartEngine dynamic line graph along the y-axis?
When I dynamically plot values I wish to display the recent plotted value. How to do that?
I wish to plot y- axis values in range 20 to 200 and want to display only 5 values so I have used mRenderer.setYLabels(5); But, when I do so grid lines are displayed for only those values. And user will not be able to know the exact y axis co-ordinate. How to show grid lines for each value and show labels for only some values?
If I manually scroll graph horizontally towards right or left, x-axis labels change. I set range as 0-10 with setXLables(2); but it changes to 0,5,10… How to control this behavior?
These should be 4 separate questions, not numbered ones. So, I will only answer the first one of them:
You can set the min and max displayed values:
renderer.setXAxisMin(minValue);
renderer.setXAxisMax(maxValue);
If by scrolling you mean panning, then this is the way to do:
renderer.setPanEnabled(false, false);
renderer.setZoomEnabled(false, false);

achartengine - inclined labels position

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

Categories

Resources