wx-charts图表滑动功能

本文介绍了如何使用wx-charts插件实现图表的滑动功能。首先提供插件下载地址和API文档链接,然后详细讲解了绑定触摸事件(bindtouchstart, bindtouchmove, bindtouchend)以及在canvas元素上的应用。接着展示了引入插件、配置参数(包括enableScroll为true以启用滑动)和创建图表的步骤。最后,展示了在touchstart、touchmove和touchend事件中调用mychart的方法来处理滑动操作。" 133006677,1386968,Linux内核变量读取技巧,"['Linux', '内核开发', '调试工具']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

插件下载地址已经api文档

https://github.com/xiaolin3303/wx-charts

要实现滑动页面部分需要绑定这三个事件bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchend"

<canvas canvas-id='areacanvas' class='canvas' bindtouchstart="touchstart" bindtouchmove="touchmove" bindtouchend="touchend"></canvas>

第一步引入插件:

var wxCharts = require('../../utils/wxcharts.js');

var mychart;

第二步配置参数以及增加三个绑定事件

canvas:function(){

var that = this;

console.info("****" + that.data.categories + "*******" + that.data.series + "******");

mychart = new wxCharts({

canvasId: 'areacanvas',

type: 'line',

categories: that.data.cat

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值