'Google Charts x-Axis Auto-Scaling

I am working on a mobile application using Bluetooth sensor. My goal is to visualize Bluetooth data on graph.

I am receiving high amount of real time data and as the time goes by, the application gets very heavy and laggy. I guess it is because I am displaying all data that I receive. For example x-axis (time) is going to infinity. I guess if I were scaling the axis automatically, it could have been better (?). For example, only showing 5 seconds of data (0 - 5, then 1 - 6, then 2 - 7 and so on) instead of (0 - untilTheApplicationStops)... Although I couldn't find how to achieve this using LineChart. Looks like I am missing something. Any thoughts?

Thank you very much.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source