A scrollable BarChart with the ability to touch each bar using MpAndroidChart?

I am trying to create a chart in my application using MPAndroidChart .

My goal is to get a graph similar to this: enter image description here

But with some specific features.

  • The chart will be wider than the screen width, so it should have a minimum width and scroll (for width I use this workaround, but not scrollable): chart.getLayoutParams().width=100*entries.size();
  • I would like to have the same speech bubble when I click on the panel (I don’t know if there is a way to have it and scroll at the same time, since for scrolling I assume that the workaround using layout and scrollview is the only solution if this function not yet implemented)
  • and, finally, when touching one panel above, without selecting a panel (which may interfere with user scrolling, if there is a way to do it!).

    How technically possible with MPAndroidChart? Thanks in advance.

+5
source share
1 answer

Yes it is. And do not use ScrollView .

Read this to change the viewport and make the chart wider: https://github.com/PhilJay/MPAndroidChart/wiki/Modifying-the-Viewport

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

+7
source

All Articles