日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

echarts3 loading动画无法去除解决方案

發(fā)布時(shí)間:2025/3/15 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 echarts3 loading动画无法去除解决方案 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

解決方案一:

? ? ? ? ? ? ? ? ? ? ? 不使用showloading,判斷傳入數(shù)據(jù)是否為空。

? ? ? ? ? ? ? ? ? ? ? 若數(shù)據(jù)為空,覆蓋一層div。

? ? ? ? ? ? ? ? ? ? ? 若數(shù)據(jù)不為空,則隱藏div

解決方案2:

? ? ? ? ? ? ? ? ? ? ? 利用echarts的graphic。初始化是加入graphic。有數(shù)據(jù)時(shí)再利用id移除掉graphic。

初始化時(shí):

在setoption中加入:

graphic:[{type: 'group',id:'inittext',left: '1%',top: 'center',children: [{type: 'rect',z: 100,left: 'center',top: 'middle',shape: {width: 500,height: 242,},style: {fill: 'rgba(0,0,0,0.01)',}},{type: 'text',z: 100,left: 'center',top: 'middle',style: {fill: '#000',text: ['暫無數(shù)據(jù)',].join('\n'),font: '14px Microsoft YaHei'}}]}],

在有數(shù)據(jù)的setoption中加入:
?

graphic:[{id:'inittext',$action:'remove',}],

參考鏈接:https://www.w3cschool.cn/echarts_tutorial/echarts_tutorial-3u872dym.html

https://echarts.baidu.com/option.html#graphic.elements-group.bounding

https://www.echartsjs.com/gallery/editor.html?c=line-graphic

https://github.com/apache/incubator-echarts/issues/4829

總結(jié)

以上是生活随笔為你收集整理的echarts3 loading动画无法去除解决方案的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。