当前位置:网站首页>[echart] resize lodash to realize chart adaptation when window is zoomed
[echart] resize lodash to realize chart adaptation when window is zoomed
2022-07-05 16:28:00 【533_】
<template>
<div ref="chart" class="chart" />
</template>
import echarts from 'echarts';
import {
debounce } from 'lodash';
echarts Inside resize() + throttle
data() {
return {
chart:null
};
},
mounted() {
this.init();
// lodash.debounce Shake proof
this.resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize();
}
}, 100);
// monitor resize
window.addEventListener('resize', this.resizeHandler);
},
beforeDestroy() {
window.removeEventListener('resize', this.resizeHandler);
},
methods: {
init() {
this.chart = echarts.init(this.$refs.chart);
const option = {
......
};
this.chart.setOption(option);
},
},
Use echarts.resize() Realize chart adaptation when window is zoomed
边栏推荐
- 2020-2022两周年创作纪念日
- Convert obj set to entity set
- ES6深入—ES6 Class 类
- Apiccloud cloud debugging solution
- 漫画:什么是蓝绿部署?
- 《MongoDB入门教程》第04篇 MongoDB客户端
- Record the pits encountered in the raspberry pie construction environment...
- Oneforall installation and use
- 21. [STM32] I don't understand the I2C protocol. Dig deep into the sequence diagram to help you write the underlying driver
- HiEngine:可媲美本地的云原生内存数据库引擎
猜你喜欢
随机推荐
Relationship between objects and classes
Convert obj set to entity set
[graduation season] as a sophomore majoring in planning, I have something to say
scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
ES6深入—async 函数 与 Symbol 类型
异常com.alibaba.fastjson.JSONException: not match : - =
写单元测试的时候犯的错
EDI许可证和ICP经营性证有什么区别
抽象类中子类与父类
Win11如何给应用换图标?Win11给应用换图标的方法
Query the latest record in SQL
Subclasses and superclasses of abstract classes
利用GrayLog告警功能实现钉钉群机器人定时工作提醒
单商户 V4.4,初心未变,实力依旧!
Six common transaction solutions, you sing, I come on stage (no best, only better)
Some cognitive thinking
list使用Stream流进行根据元素某属性数量相加
Replknet: it's not that large convolution is bad, but that convolution is not large enough. 31x31 convolution. Let's have a look at | CVPR 2022
单商户 V4.4,初心未变,实力依旧!
Exception com alibaba. fastjson. JSONException: not match : - =









