You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/12/03 03:45:40 UTC
[GitHub] [echarts] Tiramisupxl opened a new issue, #18013: [Bug] 桑基图的lableLayout属性在生产包无效
Tiramisupxl opened a new issue, #18013:
URL: https://github.com/apache/echarts/issues/18013
### Version
5.4.0
### Link to Minimal Reproduction
_No response_
### Steps to Reproduce
1、使用vue3作为开发框架,使用了桑基图,设置了labelLayout属性,在dev运行时是正常的,但是一旦运行build命令打包后,labelLayout属性就不生效了
2、配置的属性如下:
```
const chartOpt = {
tooltip: {
trigger: 'item',
triggerOn: 'mousemove',
formatter: function (params) {
const { data } = params
let { source, target, value } = data
if (source && target) {
source = source.replace('source', '')
target = target.replace('target', '')
return `${source} → ${target} : ${value}人`
}
}
},
series: [
{
type: 'sankey',
top: 0,
left: 10,
right: 10,
draggable: false,
emphasis: {
focus: 'adjacency'
},
label: {
color: '#000',
fontSize:10,
},
labelLayout(params) {
const site = {
y: params.rect.y + params.rect.height / 2,
verticalAlign: 'middle'
}
if (params.rect.x > 100) {
return {
x: params.rect.x - params.rect.width,
align: 'right',
...site
}
} else {
return {
x: params.rect.x + params.rect.width + 10,
align: 'left',
...site
}
}
},
lineStyle: {
color: 'source',
curveness: 0.5
},
data: [
{
name: 'a'
},
{
name: 'b'
},
{
name: 'a1'
},
{
name: 'a2'
},
{
name: 'b1'
},
{
name: 'c'
}
],
links: [
{
source: 'a',
target: 'a1',
value: 5
},
{
source: 'a',
target: 'a2',
value: 3
},
{
source: 'b',
target: 'b1',
value: 8
},
{
source: 'a',
target: 'b1',
value: 3
},
{
source: 'b1',
target: 'a1',
value: 1
},
{
source: 'b1',
target: 'c',
value: 2
}
]
}
]
}
```
### Current Behavior
项目执行build后展示如下:labelLayout没有生效
<img width="459" alt="截屏2022-12-03 11 42 32" src="https://user-images.githubusercontent.com/13674347/205421026-4d16f802-f71d-4d31-bbec-8c26e2be5d1b.png">
### Expected Behavior
本地运行dev环境展示如下:可以看到labelLayout是生效了
<img width="445" alt="截屏2022-12-03 11 43 58" src="https://user-images.githubusercontent.com/13674347/205421051-2c30e2b0-c95e-4b09-9497-0040da09b207.png">
### Environment
```markdown
- OS:macOS Monterey
- Browser:Chrome 96.0.4664.55
- Framework:Vue@3
```
### Any additional comments?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] Tiramisupxl commented on issue #18013: [Bug] 桑基图的lableLayout属性在生产包无效
Posted by GitBox <gi...@apache.org>.
Tiramisupxl commented on issue #18013:
URL: https://github.com/apache/echarts/issues/18013#issuecomment-1336183026
> 按需引入需要手动引入 `LabelLayout` 下,否则 build 之后可能会被 tree-shaked
>
> ```ts
> import { LabelLayout } from 'echarts/features';
> ```
可以了,万分感谢!!!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] plainheart closed issue #18013: [Bug] 桑基图的lableLayout属性在生产包无效
Posted by GitBox <gi...@apache.org>.
plainheart closed issue #18013: [Bug] 桑基图的lableLayout属性在生产包无效
URL: https://github.com/apache/echarts/issues/18013
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] plainheart commented on issue #18013: [Bug] 桑基图的lableLayout属性在生产包无效
Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #18013:
URL: https://github.com/apache/echarts/issues/18013#issuecomment-1336099748
按需引入需要手动引入 `LabelLayout` 下,否则 build 之后可能会被 tree-shaked
```ts
import { LabelLayout } from 'echarts/features';
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org