Mpandroidchart: Scrolling and pagination

Created on 6 Aug 2016  路  8Comments  路  Source: PhilJay/MPAndroidChart

Hi. Thanks for your nice library.

Please, give me an advice - how can i add horizontal scrolling behavior like ViewPager has? Thanks for answer!

P.S. Sorry for my (possibly) bad English.

Most helpful comment

its possible , you can do it with the onChartGesture interface, i succedded with it

All 8 comments

Horizontal scrolling of what? The chart content?

You can do that by zooming in an then use your finger to scroll (like the view pager). If you want to zoom in by default, you can modify the viewport to do so:

https://github.com/PhilJay/MPAndroidChart/wiki/Modifying-the-Viewport

Thanks for answering.
Yes, scrolling of chart content, with 'pages effect', when every 'page' snaps while scrolling. For example, if i want to show only one whole week at time at XAxis - from sunday to saturday, i can set

lineChart.setVisibleXRangeMaximum(7.0f); lineChart.setVisibleXRangeMinimum(7.0f);
(7 days of week) but i don't now how to make chart not to stop in a week middle while scroll/fling. Is that possible?

Hello, I'm trying to do the exact same thing.

make chart not to stop in a week middle while scroll/fling. Is that possible?

Have you figured a way out ? Thank you !

Hi.
I tried to change the library to get this effect, but didn't succeed - page scrolling was not smooth. I didn't find any other free lib with all necessary properties. That's why I built absolutely crazy construction... I placed transparent (but touchable) ViewPager above the chart. ))) I connect its scrolling to chart's one via OnDragListener and OnPageChangeListener. So ViewPager's scroll 'snapping' animation became chart's one.
That's not easy, especially if number of pages changes. But if you have no other solutions - it's not too hard.
I remember, there also was an issue about separating scrolling gestures (these are for ViewPager) and touches for selecting data at chart. If you need, I'll show you necessary parts of my code.

I need you code.

its possible , you can do it with the onChartGesture interface, i succedded with it

How to detect the scroll finish event in line chart ? Not asking about the end of the chart. Just a listener to listen to the scroll event finish.

Hi everyone.I am using from that library .But I could not set the label of y axis like $ or K (kilo),
M(Mega).
How can I set this kind of symbols?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

galex picture galex  路  3Comments

AndroidJiang picture AndroidJiang  路  3Comments

SutharRohit picture SutharRohit  路  3Comments

botondbutuza picture botondbutuza  路  3Comments

ChenZeFengHi picture ChenZeFengHi  路  3Comments