html頁面是這樣的
<div id="showScoreDetail" style="display: none;">
<div class="layuiWindownContent">
<form class="layui-form" id="scoreFrom">
<div id="chart-score" style="width:850px; height: 360px"></div>
</form>
</div>
</div>
彈出框代碼是這樣的
var showContent = $('#showScoreDetail').html();
layer.open({
type: 1,
id: 'showLayui',
shade: false,
title: season + "季度明細",
content: showContent,
area: ['900px', '500px'],
btn: ['關閉'],
btnAlign: 'c',
success: function (layero, index) {
}, end: function () {
// $('#showScoreDetail').html(showContent);
}
});
調試看到彈框是出現了,canvas也有,就是不顯示,網上說是div有_echarts_instance屬性,需要重繪
添加如下代碼
document.getElementById('chart-score').removeAttribute('_echarts_instance_');