61,126
社区成员
发帖
与我相关
我的任务
分享阿里的F2折线图,根据不同分类切换 图表切换不同数据展示,当切换三四个以上分类时,鼠标滑动图表会出现折线图错乱显示(当前分类数据与上一个分类数据交替出现 产生页面错乱抖动的感觉),点击到时不会出现抖动错乱
if (!this.chart) {
this.chart = new F2.Chart({
id: 'container',
pixelRatio: window.devicePixelRatio,
plugins: ScrollBar
})
}
this.chart.clear()
this.chart.source(this.data, {
date: {
type: 'timeCat',
mask: 'MM/DD',
tickCount: 7,
range: [0, 1]
},
number: {
tickCount: 5,
min: 0,
alias: this.typeList[this.activeTypeIndex].formName
},
index: {
// 这里横坐标使用 index,
min: 0, // 设置刚开始显示的区间 0-5
max: 5
}
})