ba-res-ba
ba-res-ba

Reputation: 150

Swiping achartengine fragment is a bit laggy

I use achartengine in a fragment with a view pager. It works great, but if I put a lot of value (100~200) into my series swiping is a bit slow. It's weird because, when I touch the page title, fragment changing is very fast, I only have this problem during slow swiping. How should I solve this?

Additional information: - linechart with only one series - y values from 0 to 100 - x values currentTimeInMillis

Upvotes: 1

Views: 582

Answers (1)

Snicolas
Snicolas

Reputation: 38168

A solution we recently implemented is to save the view using the chart engine as a Bitmap and display the bitmap, only re-calculating the chart when values change.

Displaying a bitmap is much cheaper than displaying a chart, your swipe won't lag.

To do it, simply follow this thread.

Upvotes: 1

Related Questions