Ho to set MPAndroid piechart no lable - android

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.

Related

How to set background color according to x-axis partition values in chart with MPAndroidChart library by PhilJay?

I would like to set background color according to x-axis partition values in chart using together with line chart. Is there any way to set like this picture in android with MPAndroid Chart?
Line Chart with MPAndroid Chart
when you set bar data then use this one.
val barDataSet = BarDataSet(mListOfBarEntry, "Colors")
barDataSet.color = resources.getColor(R.color.colorPrimary)
In this i have changed the background color of bar.

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 differnt label color for y-axis

I am using the library com.github.PhilJay:MPAndroidChart:v2.0.9 for displaying a barchart .
I want to set different colors for each label in the Y axis. Is it possible to do this? How do I do this?

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 set legend on left axis

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

Categories

Resources