Mpandroidchart How to set legend on left axis - android

I need to put a legend in MPAndroidChart like the image this link
https://drive.google.com/file/d/0B84Wox8FntslUVhiM1R1OTJqbEE/view?usp=sharing

Try like this
chart.getLegend().setPosition(LegendPosition.LEFT_OF_CHART);

Related

Ho to set MPAndroid piechart no lable

I'v used MPAndroid PieChart and want to show only percent values without labels. When I remove labels then colored guide below of chart also is without label. How to remove labels from pichart without removing guide labels?
set setDrawLabels(false) for the axis.
setDrawLabels(boolean enabled): Set this to true to enable drawing the labels of the axis.

How to solve below chart problems with `MPChartAndroid`?

I have 3 issue related to MPChartAndroid.
How to make chart to see selected values.
1. Add space to the left of LeftAxis and to the right of rightAxis to fully see the values.
2. how to make first and last chart value to fully see the values.
3. Add space under xAxis to see the cut text.
To overcome issue with cutoff x-Axis label, you need to set some extra space on bottom of your chart view.
mLineChart.setExtraOffsets(left,top,right,bottom); try code below
mLineChart.setExtraOffsets(0,0,0,10);
For overcome issue with overlapping value on axis line you need to set some spacing (start position of lines) on x-Axis, try code below
xAxis.setSpaceMax(0.01f);
xAxis.setSpaceMin(0.01f);
also try xAxis.setAvoidFirstLastClipping(true);

MPAndroidChart: How do I remove gridlines?

In my LineChart beside the lines that are shown on the full numbers parallel to the x-axis, many horizontal gridlines are shown:
How can I get rid of these lines?
Those look like axis lines. You can toggle the axis lines by calling setDrawGridLines(false) on each Chart axis. For example, to clear all of them simply do something like this.
LineChart myChart = ...;
myChart.getXAxis().setDrawGridLines(false);
myChart.getAxisLeft().setDrawGridLines(false);
myChart.getAxisRight().setDrawGridLines(false);

MPAndroidChart - how to create vertical y-axis labels at bottom of the chart?

how to create vertical y-axis labels at bottom of the chart?
this is what my current chart looks like: https://db.tt/F5M3iAPQ
this is what I want: https://db.tt/mCpy6YuP
I already posted this issue on the author's github, issue #209
Thanks

Android - How can align the labels' text with their axis?

I'm using achartengine. I don't know how to align the labels' text with their axis. On some screens, the text is centered with the axis; on other screens, they're on the bottom or on the top of the axis.
Is there a way to globally put them in the center of the axis?
I think you can use the following:
mRenderer.setYLabelsAlign(Align.LEFT, 0)
If you want to set the alignment on the right side of the grid, just set Align.LEFT, which means they are align on the left.
Reading these two threads might clear it more: Android AChartEngine - Unable to change textColor of Y-Axis Labels and AChartEngine : Align Y-Axis Labels on right side of Axis itself
Hope it helps.

Categories

Resources