I'm drawing a BarChart with AChartEngine on Android.
I made the chart horizontal by changing the orientation of the XYMultipleSeriesRenderer:
mMSRenderer.setOrientation(Orientation.VERTICAL);
(it seems counter-intuitive that horizontal is set with Orientation.VERTICAL, but that's not the point of my question).
The origin of the plot is on the top left corner, while I would like it in the bottom left, so that values go increasing from the bottom to the top.
Is this possible?
This is not possible with AChartEngine as it is out of the box.
However, you can try to put your data in your dataset in a reversed order and add custom labels instead of the default ones.
Related
I'm using MPAndroidChart in order to draw two charts however when the two values are close they overlap like the picture
is there a way to solve this for example by setting padding on values on the red chart to be drawn on top of the green one?
I've searched the wiki, SO, the issues section of https://github.com/PhilJay/MPAndroidChart/issues, but have been unable to find an answer to my question.
I simply want to change the position of the y-axis values above the horizontal grid lines. I can move them into the graph with leftAxis.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART), but there doesn't seem to be any way to move their position vertically.
Here is what I am trying to achieve:yaxis_label_above
Here is what it currently looks like:
yaxis_label_on_line
Is it possible to move the position of the y-axis labels vertically either up or down?
The AxisValueFormatter interface (Link)
More details please refer to How can I alter the spacing for the Y-Axis Labels in MPAndroidchart?
That orange area is also given to AchartEngine to draw its graph. Achartengine occupies that area for it's legend. But even i have done dr.setShowLegend(false); , achart does not occupy or adjust it's graph location according to that area. Also i can not shrink the graph view because the reason above, pie chart would also shrink. What i ask is, is there any way to customize there (custom legend) or make pie fill up almost all area?
You can Use setMarginsmethod to set Some margin of PieChart .
mRenderer.setMargins(new int[] {top, left, bottom, right});
Two questions regarding the GraphView library.
1) With manual setNumVerticalLabels set when switching from scrolling to scaling and vice versa, that the labels for my y-Axis change it's position. In scrolling mode they are closer together and in scaling mode a bit further apart.
In case of having the number of labels set automatically, the number of labels also changes between the two modes.
Is this a known bug? Is there any way to get around that behavior?
2) Is it possible to claim the space above the graph for the graph if the title is left empty?
Thanks for any help!
1) that is because your labels could need more space. You have 2 options:
a) set a fixed width for the vertical labels
or b) make sure that the labels have a fixed/limited count of characters via custom label formatter.
2) this is not possible with GraphView 3.x, but in GraphView 4.0 this is be fixed.
As of right now if I have a line chart value that is straight horizontal or vertical and happens to be the exact value as one of the grid lines, then it becomes really tough to see. Is there any way to change the Z order of how things are drawn such that everything draws over the grid lines?
No, there isn't such API.
However, you can play with the colors, for instance set some transparency level of the grid lines color, axes color.