AChartEngine chart margin - android

I have two question by AChartEngine:
1. How add margin between YLabel and chart?
2. I change label text size but when no data it's not working, what I can use instead?
Screenshot for fisrt question:
Regards

Related

MPAndroidChart. Can't force labels to have an equal spacing

I'm using MPAndroidChart library and can't make labels to have an equal spacing.
When setAvoidFirstLastClipping(false) I get this:
As you can see only label 1 has shifted, others two didn't move a bit.
I also played with getXAxis().setSpaceBetweenLabels(10); The best outcome was:

How to increase the horizontal chart value text size in MPAndroidChart

I am using MPAndroidChart, I want to set the barchart values in center of the bar and with bigger font.
mChart.setDrawValueAboveBar(false);
By using the above the value is shown inside the bar but not at the center.I am using MpChart
Thanks in advance
By default, it is not possible to center the values, you will have to add that feature yourself.
Concerning the textsize, try:
barDataSet.setValueTextSize(...)
Styling individual DataSets
Styling all ChartData

GraphView label font size and spacing

Add space between graph and tick labels in GraphView? answers how to add a space between the graph and axis labels
Android graph view has an answer which says it is possible to change the font size of axis labels.
However it seems those functionalities have been removed. are there any plans to reinstate them? Alternatively, are there currently ways to change the font size and spacing?
Thanks!
I change the label's text size in this way:
graph.getGridLabelRenderer().setTextSize(6f);
graph.getGridLabelRenderer().reloadStyles();

MPAndroidChart Labels displays all in one line - Need to wrap

I am creating a chart using MPAndroidChart with 10 data sets using one of the examples provided. My labels are displaying all on one single line and are not wrapping. They are getting chopped off on the right.
Legend l = mChart.getLegend();
l.setForm(Legend.LegendForm.SQUARE);
l.setPosition(Legend.LegendPosition.BELOW_CHART_LEFT);
I would like to display the labels in multi-lines. Any ideas please?
Currently this library does not support a "wrapping" mechanism for the Legend.
However a workaround could be to set the legend-position to be somewhere right of the chart.
In that way there should be more space for entries when they are aligned vertically instead of horizontally.

How to set chart height closer to bottom using AChartEngine?

Refer to the image above. In AChartEngine, although Zoom Buttons are hidden using method setZoomButtonsVisible(false), it leaves a large space between the X-axis to the bottom.
How do I make the chart stick to the bottom? I have tried many methods without success.
There are multiple way to do this. Please see a few of them below:
Set the height of the legend manually: renderer.setLegendHeight(height);
Make the legend size itself to occupy the needed space: renderer.setFitLegend(true);
Don't show the legend at all: renderer.setShowLegend(false);

Categories

Resources