19

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?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
karuppiah
  • 522
  • 1
  • 5
  • 19
  • Did you find a answer to this? – user1408682 Sep 28 '15 at 08:09
  • 1
    Hi dude, sorry for the late reply.Yes i did it there is a property we have to add the set1.setDrawValues(false); in LineDataSet set values properties.Once we changed to false the values are not displayed on points.Hope this will be helpful for you, thanks. – karuppiah Sep 29 '15 at 14:27
  • Thanks i actually figured it out myself – user1408682 Sep 30 '15 at 14:30
  • Hi, you can have your comment as response for this question. – Kevin ABRIOUX Nov 17 '15 at 15:28
  • Hi, yes this is the answer i did in my code and it made changes too. – karuppiah Nov 18 '15 at 11:30
  • I'm glad you figured it out, and it looks like one other person at least might find it helpful. You should add your original code to the question, though, so that the answer has some useful context, and to help other people find the question and answer. – Mogsdad Nov 18 '15 at 11:39

4 Answers4

30

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
karuppiah
  • 522
  • 1
  • 5
  • 19
2

If you want to keep the value but remove the Label (as it may already exist in the legend) the do mChart.setDrawEntryLabels(false);

suku
  • 10,507
  • 16
  • 75
  • 120
1

i use this it worked for me

   dataSet.setValueFormatter(new DefaultAxisValueFormatter(0));

or

dataSet.setValueFormatter(new DefaultValueFormatter(0));

hope this help you

0

Set the value of the text size to 0f, and this would accomplish what you wanted

set1.setValueTextSize(0f);
Unheilig
  • 16,196
  • 193
  • 68
  • 98
INavin
  • 11
  • 1