美文网首页
echart2.x 清除ECharts气泡提示“暂无数据”

echart2.x 清除ECharts气泡提示“暂无数据”

作者: 文芬 | 来源:发表于2021-09-01 18:06 被阅读0次

1、echart2.X 无数据时显示气泡,改成白底【暂无数据】模式

noDataLoadingOption: {
                    text: '暂无数据',
                    effect: 'bubble',
                    effectOption: {
                        backgroundColor: "rgba(0,0,0,0)",
                        effect: {
                            n: 0
                        }
                    },
                    textStyle: {
                        color: '#ffffff'
                    }
                },

2、清除暂无数据

  • 初始化页面,加在图表,为空,显示气泡或暂无数据;
  • 刷新图表,有数据,显示暂无数据和图表。

echarts.setOption(option2, true) // 没效果

解决方法:
echarts.setOption(xx)之前,调用一次echarts.hideLoading()

相关文章

网友评论

      本文标题:echart2.x 清除ECharts气泡提示“暂无数据”

      本文链接:https://www.haomeiwen.com/subject/zxqfwltx.html