Table of contents
报错:export 'default' (imported as 'echarts') was not found in 'echarts'。
报错:There is a chart instance already initialized on the dom。
Charts are not displayed
Be sure to set the height and width.
<div id="chart style="width:500px; height:500px" ></div>
报错:export 'default' (imported as 'echarts') was not found in 'echarts'。
current version
solution
npm install [email protected]
报错:There is a chart instance already initialized on the dom。
An instance has been initialized on the dom, and if a click method is defined in your chart, after multiple overrides, the click method will be triggered multiple times. This warning occurs when the update page reloads this chart instance.
var mychart
if (mychart != null && myChart != "" && myChart != undefined) {
myChart.dispose()
}
myChart = echarts.init(document.getElementById('container'));
let myChart = this.$echarts.getInstanceByDom(this.$refs[this.chart.type]);
if (myChart == null) {
myChart = this.$echarts.init(this.$refs[this.chart.type]);
}
myChart.setOption(option);