apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.42k stars 19.61k forks source link

[Bug] 5.5.1存在问题,我之前项目引入的版本是5.3.3;但我node-module更新的版本是5.5.1;打包上线后,所有的echarts组件都显示不正常;所有的字都缩在一块了,图表能显示出来 #20211

Open oracle11770 opened 2 months ago

oracle11770 commented 2 months ago

Version

5.5.1

Link to Minimal Reproduction

我之前项目引入的版本是5.3.3;但我node-module更新的版本是5.5.1;打包上线后,所有的echarts组件都显示不正常;所有的字都缩在一块了,图表能显示出来

Steps to Reproduce

我之前项目引入的版本是5.3.3;但我node-module更新的版本是5.5.1;打包上线后,所有的echarts组件都显示不正常;所有的字都缩在一块了,图表能显示出来

Current Behavior

我之前项目引入的版本是5.3.3;但我node-module更新的版本是5.5.1;打包上线后,所有的echarts组件都显示不正常;所有的字都缩在一块了,图表能显示出来

image

Expected Behavior

正常显示

image

Environment

- Browser:

Any additional comments?

No response

echarts-bot[bot] commented 2 months ago

@oracle11770 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** [Bug] There is a problem with 5.5.1, the version I introduced in my previous project is 5.3.3, but the version I updated to node-module is 5.5.1; after the packaging is online, all the echarts components are displayed abnormally, all the words are shrunk together, the chart can be displayed, if you use 5.3.3, it's no problem
plainheart commented 2 months ago

引入一下 LabelLayout

import * as echarts from 'echarts/core'
import { LabelLayout } from 'echarts/features'

echarts.use(LabelLayout)
kankan-web commented 2 months ago

哭了😭,感觉没有用啊,我大概是这样按需引入echarts的,https://github.com/kankan-web/vue-demo/blob/master/src/plugins/echarts.ts

oracle11770 commented 2 months ago

引入一下 LabelLayout

import * as echarts from 'echarts/core'
import { LabelLayout } from 'echarts/features'

echarts.use(LabelLayout)

我尝试了您的方案 并不能解决我的问题; 我自己后来无意间发现是配置的插件 UglifyJsPlugin跟echarts版本有冲突;我注释UglifyJsPlugin就没问题; 后来找到了替代压缩插件TerserPlugin 就没问题;推测是因为echarts含有es6 语法;但官网说他们会根据当前项目 选择es5,还是es6; 所以我现在不知道是什么原因;但使用TerserPlugin确实可以解决问题;

kankan-web commented 2 months ago

引入一下 LabelLayout

import * as echarts from 'echarts/core'
import { LabelLayout } from 'echarts/features'

echarts.use(LabelLayout)

我尝试了您的方案 并不能解决我的问题; 我自己后来无意间发现是配置的插件 UglifyJsPlugin跟echarts版本有冲突;我注释UglifyJsPlugin就没问题; 后来找到了替代压缩插件TerserPlugin 就没问题;推测是因为echarts含有es6 语法;但官网说他们会根据当前项目 选择es5,还是es6; 所以我现在不知道是什么原因;但使用TerserPlugin确实可以解决问题;

能问问,这是怎么找到的吗?我感觉我也是同样的问题,都不知道从何下手😂

echarts-bot[bot] commented 2 months ago

@oracle11770 Please provide a demo for the issue either with Official Editor, CodePen, CodeSandbox or JSFiddle.

kankan-web commented 2 months ago

引入一下 LabelLayout

import * as echarts from 'echarts/core'
import { LabelLayout } from 'echarts/features'

echarts.use(LabelLayout)

我尝试了您的方案 并不能解决我的问题; 我自己后来无意间发现是配置的插件 UglifyJsPlugin跟echarts版本有冲突;我注释UglifyJsPlugin就没问题; 后来找到了替代压缩插件TerserPlugin 就没问题;推测是因为echarts含有es6 语法;但官网说他们会根据当前项目 选择es5,还是es6; 所以我现在不知道是什么原因;但使用TerserPlugin确实可以解决问题;

亲测,有效,非常感谢😍😍😍😍