I am working on designing a Line chart using the MPAndroidChart library. in that chart, the "points labels" should be removed or suppressed, and once we click that point circle the marker should be displayed. However, right now it displays the point labels on each point circle, so what I need is to show the point in the marker only once it is clicked. Also, while I've tried to customize the chart the Y-axis points are displayed as float
; I have tried to display them as int
but that won't work.
How can I fix this?
I found the answer at last. We have to add set1.setDrawValues(false);
in LineDataSet
value properties. This will make the changes, as the points are not displayed.
LineDataSet set1 = new LineDataSet(yVals1, "");
set1.setDrawValues(false);
ArrayList<LineDataSet> dataSets = new ArrayList<LineDataSet>();
dataSets.add(set1); // add the datasets
If you want to keep the value but remove the Label (as it may already exist in the legend) the do mChart.setDrawEntryLabels(false);
i use this it worked for me
dataSet.setValueFormatter(new DefaultAxisValueFormatter(0));
or
dataSet.setValueFormatter(new DefaultValueFormatter(0));
hope this help you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With