echarts 卡_求助!echarts加载大量数据,内存不断增加导致浏览器很卡甚至崩溃;...

本文主要探讨如何优化Echarts在加载大量数据时的性能问题,防止因内存不断增长而引起的浏览器卡顿或崩溃。通过对Echarts配置项的调整,如使用dataZoom组件限制可视范围,以及适时地清空图表数据,可以有效改善用户体验。
摘要由CSDN通过智能技术生成

那应该如何清空呢?option比较长:

this.chart3_1.setOption({

title: {

text: (this.isEn)? this.$t('SG')+' (mg/dL)':this.$t('SG')+' (mmol/L)',

textStyle: this.textStyle,

padding: this.titlePadding,

},

tooltip:{},

xAxis: [{

type: 'time',

boundaryGap: false,

min:new Date(this.startTime),

max:new Date(this.startTime+8.64e7),

axisLine: {lineStyle: {color: '#ccc'}},

splitNumber: 24,

splieLine:{show:true},

axisLabel:{

margin: 15, textStyle: {color: '#282828', baseline: 'middle'} ,

formatter:function (value,index) {

let H = new Date(value).getHours();

if(index<24){

if(index%3===0){

H = H<10 ? ('0'+H+':00' ): H+':00';

return H;

}else{

return ' ';

}

}else{

return H+24+':00';

}

}

},

}],

yAxis: [{

type: 'value',

min:0,max:(this.isEn)? 400:25,

axisLabel: this.yAxisLabel,

axisLine: {lineStyle: {color: '#ccc'}},

boundaryGap: false,

axisTick: {length: 0},

}],

grid: this.grid,

animation:false,

dataZoom:[

{

id:'dataZoomX',

type:'slider',

xAxisIndex:0,

filterMode:&

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值