On the current page, when you execute charts drawing for many times, the console will give a warning “there is a chart instance already initialized on the DOM”, which means: “a chart instance has been initialized on the DOM”
Solution:
Add the method of drawing ecarts to judge whether it already exists. If it exists, it can be destroyed. The code example is as follows:
data() {
return {
myRingChart1:null
}
}
drawRing1() {
if (
this.myRingChart1 != null &&
this.myRingChart1 != '' &&
this.myRingChart1 != undefined
) {
this.myRingChart1.dispose() //Solve the error reported by echarts dom already loaded
}
// Initialize the echarts instance based on the prepared dom
this.myRingChart1 = echarts.init(this.$refs['myRingChart1'])
}
Read More:
- [Solved] Import Echars5.0 Error: “export ‘default‘ (imported as ‘echarts‘) was not found in ‘echarts‘
- Chart.min.js:10 Failed to create chart: can’t acquire context from the given item
- The echots in Vue reports an error. After obtaining the DOM element, the chart can be displayed. The console still reports an error
- #An error is reported by the chart map component of renfast framework
- Uncaught Error: _registerComponent(…): Target container is not a DOM element
- Error: Target container is not a DOM element.
- C# Member XXX cannot be accessed with an instance with an instance reference;qualify it with a type
- Vue Error: initialize failed: invalid dom [How to Solve]
- Property xxx was accessed during render but is not defined on instance
- How does lightningchart, a high performance chart control, draw maps in 3D?
- Vue references echats and reports an error initialize failed: invalid DOM
- In echarts label.formatter Non effectiveness
- Error in pyinstall package Python program: jinja2.exceptions.templatenotfound: Chart_ Solution to component.html
- The garbage plug-in mixed in chrome causes an error in the front-end JS operation: only one instance of Babel Polyfill is allowed
- Solution: attributeerror: type object ‘ioloop’ has no attribute ‘initialized’
- ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
- ImportError: cannot import name ‘SummaryWriter‘ from partially initialized module ‘torch.utils.tenso
- pygame.error: video system not initialized
- appear pygame.error : font not initialized problem, remember to check whether the program calls pygame.init ()
- RuntimeError: Default process group has not been initialized, please make sure to call init_process_