There is a chart instance already initialized on the dom!警告
使用Echarts插件的时候,多次加载会出现There is a chart instance already initialized on the dom.这个错误,改插件已经加载完成。
并且如果你图表中定义了点击方法,多次覆盖之后,点击方法会触发多次
解决方法:
在方法最外层定义全局变量
var myCharts;
然后在插件使用方法中:
if (myChart != null && myChart != "" && myChart != undefined){
myChart.dispose();
}
// 基于准备好的dom,初始化echarts实例
myChart = echarts.init(document.getElementById('sjtjt'));
方法的最开始写上判断,然后初始化echarts实例;
最重要的就是全局定义和方法开头的判断然后
myChart.dispose();
There is a chart instance already initialized on the dom!警告的更多相关文章
- 多次执行echarts时出现 there is a chart instance already initialized on the dom
原因,多次使用 echarts.init(document.getElementById(this.options.zid)); 解决方案 设为全局
- echarts 知识点
echarts map 禁止放大缩小,设置 calculable 为 false 即可. calculable: false echarts 报错: There is a chart instance ...
- 通过百度echarts实现数据图表展示功能
现在我们在工作中,在开发中都会或多或少的用到图表统计数据显示给用户.通过图表可以很直观的,直接的将数据呈现出来.这里我就介绍说一下利用百度开源的echarts图表技术实现的具体功能. 1.对于不太理解 ...
- 三种Singleton的实现方式
来源:http://melin.iteye.com/blog/838258 三种Singleton的实现方式,一种是用大家熟悉的DCL,另外两种使用cas特性来实现. public class Laz ...
- Multiton & Singleton
From J2EE Bloger http://j2eeblogger.blogspot.com/2007/10/singleton-vs-multiton-synchronization.html ...
- Runtime运行时的那点事儿
注:本文是对 Colin Wheeler 的 Understanding the Objective-C Runtime 的翻译. 初学 Objective-C(以下简称ObjC) 的人很容易忽略一个 ...
- 5.Primitive, Reference, and Value Types
1.Programming Language Primitive Types primitive types:Any data types the compiler directly supports ...
- OC基础(12)
new方法实现原理 类的本质 类的启动过程 *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bo ...
- Why String is immutable in Java ?--reference
String is an immutable class in Java. An immutable class is simply a class whose instances cannot be ...
随机推荐
- P1993 小K的农场
P1993 小K的农场比较裸的差分约束,只是我判负环的时候sb了... 有负环意味着无解 #include<iostream> #include<cstdio> #includ ...
- 李宏毅机器学习笔记6:Why deep、Semi-supervised
李宏毅老师的机器学习课程和吴恩达老师的机器学习课程都是都是ML和DL非常好的入门资料,在YouTube.网易云课堂.B站都能观看到相应的课程视频,接下来这一系列的博客我都将记录老师上课的笔记以及自己对 ...
- 003.DNS主从正反解析部署
一 实验环境 1.1 实验需求 配置正向解析bind 配置反向解析bind 配置辅助dns的bind 实现主辅dns之间的区域传送 1.2 环境规划 主dns:CentOS6.8-01 172.24. ...
- RFC2616-HTTP1.1-Header Field Definitions(头字段规定部分—译文)
part of Hypertext Transfer Protocol -- HTTP/1.1 RFC 2616 Fielding, et al. 14 头字段规定 该章节定义了HTTP1.1标准所包 ...
- lvs负载均衡概述
- vue中的组件
一.自定义组件1.组件命名 A.dom模板在HTML模板中始终使用kebab-case命名组件 <kebab-cased-component> </kebab-cased-com ...
- python系统编程(十一)
同步应用 多个线程有序执行 from threading import Thread,Lock from time import sleep class Task1(Thread): def run( ...
- JS 私有变量
严格来讲,JS之中没有私有成员的概念:所以对象属性都是公有的.不过,倒是有一个私有变量的概念. 任何在函数中定义的变量,都可以认为是私有变量,因为不能在函数的外部访问这些变量. 私有变量包括函数的参数 ...
- C# Json序列化去掉k__BackingField问题的解决方案
方案一: 如果是WebAPI,可以加入全局设置: GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettin ...
- GetLastError
GetLastError返回错误表[0]-操作成功完成. [1]-功能错误. [2]-系统找不到指定的文件. [3]-系统找不到指定的路径. [4]-系统无法打开文件. [5]-拒绝访问. [6]-句 ...