首次触摸后,AChartEngine图表将失去自动跟踪功能(AChartEngine chart lose auto following after first touch)

我目前正在使用AChartEngine库来绘制我的传感器数据。 它工作正常,当我收到新数据时,图表会滚动并正确更新Y轴值。 问题是当我触摸图表以手动缩放,移动或其他任何东西时:图表失去了他的“自动跟随”智能,并且缩放控件中的“中心图表”按钮也没有正确地整个图表居中(但它关注的是“旧数据“,在我第一次接触之前)。

我怎么解决?

I'm currently using AChartEngine library to dinamically draw my sensor data. It's working fine and when i receive new data the chart scroll and update Y axis values correctly. The problem is when i touch the chart to manually zoom, move or anything else: the chart loses his "auto following" intelligence and also the "center chart" button in the zoom controls does not center correctly entire chart (but it focus on "old data", before my first touch).

How can i solve?

最满意答案

手动更改可见区域后,它不再手动更新。 如果要保留更新功能,可以禁用缩放和平移。

renderer.setZoomEnabled(false, false); renderer.setPanEnabled(false, false);

Once you change the visible area manually, it no longer updates it manually. You could probably disable zoom and pan if you want to keep the update feature.

renderer.setZoomEnabled(false, false); renderer.setPanEnabled(false, false);

更多推荐