Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrollable BarChart with possibility to touch each bar using MpAndroidChart?

I'm trying to create a chart in my app using MPAndroidChart.

My aim is to get a graph looking like this one: enter image description here

But with some specific features.

  • The graph will be wider than the screen's width so it must have a minimum width and be scrollable ( for the width I'm using this workaround, but its not scrollable ): chart.getLayoutParams().width=100*entries.size();
  • I would like to have the same kind of speech bubble on click on a bar ( I don't know if there is a way to have it and the scroll in the same time since for the scroll I guess a workaround using layout and scrollview is the only solution if this feature is not implemented yet)
  • and finally, when touching above one of the bar, not selecting the bar under ( which could prevent the user to scroll if there is a way to do so! ).

    Is it technically possible with MPAndroidChart yet? Thanks in advance.

like image 298
Virthuss Avatar asked Sep 15 '15 04:09

Virthuss


1 Answers

Yes, it is. And please do not use ScrollView.

Read this for modifying the viewport and "making the chart wider": https://github.com/PhilJay/MPAndroidChart/wiki/Modifying-the-Viewport

The "speech bubble" you are talking about is the MarkerView, and yes, it can be displayed when scrolling as well.

like image 129
Philipp Jahoda Avatar answered Oct 15 '22 19:10

Philipp Jahoda