惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
Y
Y Combinator Blog
The Cloudflare Blog
V
V2EX
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
MyScale Blog
MyScale Blog
Martin Fowler
Martin Fowler
T
Tailwind CSS Blog
P
Privacy International News Feed
S
Securelist
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tor Project blog
P
Proofpoint News Feed
Project Zero
Project Zero
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Help Net Security
美团技术团队
The GitHub Blog
The GitHub Blog
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Security Latest
Security Latest
NISL@THU
NISL@THU
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Secure Thoughts
Cyberwarzone
Cyberwarzone
Scott Helme
Scott Helme
IT之家
IT之家
Last Week in AI
Last Week in AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy & Cybersecurity Law Blog
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
S
Schneier on Security
L
Lohrmann on Cybersecurity
S
Security Affairs
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
云风的 BLOG
云风的 BLOG

博客园 - 微宇宙

js-金额相加 小程序- 字符数据换行 antd-输入框去掉光晕 大屏缩放布局 大屏显示 echarts - 原型的方向盘动画 小程序- 自定义导航栏组件封装 小程序-echart动画git仓库 小程序- 隐私协议完善 小程序- 日期picker样式问题 echart - 折线图显示设置 echart - 移动端提示内容无阴影 echart 柱状图 - 零界点 正负方向展示 小程序 - 导航栏 图标设置 小程序 - 错误问题记录 react项目全屏功能 react-大屏显示antd浮窗 React andt库设置主题色彩 React闭包陷阱 git 操作 小程序 - 订阅消息通知 小程序-分包 mysql安装使用 redis安装使用 echart 格式化水平坐标 tooltip数据 小程序-模板用法 小程序-登录验证码的加载方式 工作代码规范 小程序-锚链接 小程序-菜单tabbar设置 小程序-分享功能 小程序-树形结构 array数组 js 小程序-标题自定义设置 小程序-拨打电话
小程序-图表
微宇宙 · 2025-12-03 · via 博客园 - 微宇宙

如i果要封装图表组件,可以基于这个案例,每次传入的是一个对象即可。

 import * as echarts from '../echarts';

this

.ecComponent = this.selectComponent('#chart'); this.ecComponent.init((canvas, width, height, dpr) => { const chart = echarts.init(canvas, null, { width: width, height: height, devicePixelRatio: dpr // new }); chart.setOption(c_option); this.chart = chart; this.setData({ isLoaded: true, }); // 注意这里一定要返回 chart 实例,否则会影响事件处理等 return chart; });

其中,下载图表定制化的 线和壮壮图js,本地运行报错。

// 下载好替换之后,提示什么TypeError: t.domTarget.addEventListener is not a functionfunction Ii(t, e, n, i) {
  t.mounted[e] = n, t.listenerOpts[e] = i, t.domTarget.addEventListener(e, n, i)
}
// 直接改成
function Ii(t, e, n, i) {
  t.mounted[e] = n, t.listenerOpts[e] = i, 1
}
// 也就是删掉 ,
t.domTarget.addEventListener(e, n, i)

https://github.com/ecomfe/echarts-for-weixin/blob/82e6cdfe5347265c04cced222bd6398dcb6eb279/pages/lazyLoad/index.js#L10