-1

I want to break the dataPoint to get only values of Y axis. right now the result i get when my code runs is :

Diastolic Reading: [25.0/89.0] mmHg

however i want to display it as:

Diastolic Reading: 89.0 mmHg

series_D.setOnDataPointTapListener(new OnDataPointTapListener() {
        @Override
        public void onTap(Series series, DataPointInterface dataPoint) {
            Toast.makeText(Rsults.this, "Diastolic Reading : "+ dataPoint +" mmHg", Toast.LENGTH_SHORT).show();
        }
    });
Pohur
  • 5
  • 1
  • 7
  • What do you mean by "break"? What view is GraphView, like where does it come from? This isn't a view in the Android UI toolkit. – cincy_anddeveloper Jan 17 '18 at 15:22
  • what about using **right property(getter)** instead using object.toString() (which obviously is used when you are concating string object with other object)? ... very advanced hint: in almost all modern IDE you will get name of getters by writing dot after variable name (and since DataPointInterface seems to gave only 2 getters you will prolly choose the right one)... we call this magic intellisense – Selvin Jan 17 '18 at 15:28
  • @Selvin Thank you so much. I have been able to make it work. I used: Double x = dataPoint.getY(); and then i put the variable x in the toast. Thank you again – Pohur Jan 17 '18 at 16:30
  • @WadeWilson It is an open-source API http://www.android-graphview.org/ – jseashell Jan 29 '18 at 18:49

1 Answers1

0

The code is now working as I wanted by the help of Selvin

series_b.setOnDataPointTapListener(new OnDataPointTapListener() {
        @Override
        public void onTap(Series series, DataPointInterface dataPoint) {
           Double x = dataPoint.getY();
            Toast.makeText(Rsults.this, "Systolic Reading : "+ x +" mmHg", Toast.LENGTH_SHORT).show();
        }
    });
Pohur
  • 5
  • 1
  • 7