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.
Related
I am using AndroidPlot in my project and am trying to figure out why the same code leads to a different legend design on two phones.
On one phone the legend shows the line inside a black box, which makes it hard to see, on another phone I get a nice box in the line colour, which is the behaviour I want.
Screenshot showing two legends side by side
Please ignore the overlapping legend text in the screenshot, that's the next problem I need to fix.
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:
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
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
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);