简体   繁体   English

AnyChart 折线图缩放

[英]AnyChart Line chart zoom

I am working on an Android app and i need to plot some data on line chart.我正在开发一个 Android 应用程序,我需要在折线图上绘制一些数据。 I am using the Anychart https://github.com/AnyChart/AnyChart-Android .我正在使用 Anychart https://github.com/AnyChart/AnyChart-Android I need to zoom and drag the chart but I don't know how to do it.我需要缩放和拖动图表,但我不知道该怎么做。 https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/LineChartActivity.java here is sample code for the chart. https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/LineChartActivity.java这里是图表的示例代码。

In the current version of the library, the Line chart supports xScroller feature.在当前版本的库中,折线图支持 xScroller 功能。 A user can use it to drag the chart and zooming.用户可以使用它来拖动图表和缩放。 To enable it simply add the following line to the sample code you provided:要启用它,只需将以下行添加到您提供的示例代码中:

cartesian.xScroller(true);

Here is the result:结果如下: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM