Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] toolbox的saveAsImage选项的excludeComponents排除toolbox时,图标的title依然会被绘制在图中 #16673

Closed
life-as-flowers opened this issue Mar 14, 2022 · 8 comments · Fixed by #16704

Comments

@life-as-flowers
Copy link

life-as-flowers commented Mar 14, 2022

Version

5.3.0

Link to Minimal Reproduction

No response

Steps to Reproduce

let option = {
    toolbox: {
        show: true,
        feature: {
            dataZoom: {
                yAxisIndex: "none"
            },
            dataView: {
                readOnly: false
            },
            magicType: {
                type: ["line", "bar"]
            },
            restore: {},
            saveAsImage: {
                excludeComponents: ["toolbox"]  // 排除toolbox组件后组件的图标的title依然会被生成到图中
            },
        }
    },
    xAxis: {
        type: "category",
        boundaryGap: false,
        data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
    },
    yAxis: {
        type: "value",
        axisLabel: {
            formatter: "{value} °C"
        }
    },
    series: [{
        name: "最高气温",
        type: "line",
        data: [11, 11, 15, 13, 12, 13, 10],
        markPoint: {
            data: [{
                type: "max",
                name: "Max"
            }, {
                type: "min",
                name: "Min"
            }]
        },
        markLine: {
            data: [{
                type: "average",
                name: "Avg"
            }]
        }
    }, {
        name: "最低气温",
        type: "line",
        data: [1, -2, 2, 5, 3, 2, 0],
        markPoint: {
            data: [{
                name: "周最低",
                value: -2,
                xAxis: 1,
                yAxis: -1.5
            }]
        },
        markLine: {
            data: [{
                type: "average",
                name: "Avg"
            },
            [{
                symbol: "none",
                x: "90%",
                yAxis: "max"
            }, {
                symbol: "circle",
                label: {
                    position: "start",
                    formatter: "Max"
                },
                type: "max",
                name: "Top"
            }]
            ]
        }
    }]
};

export default option;

Current Behavior

toolbox的saveAsImage选项的excludeComponents排除toolbox时,图标的title依然会被绘制在图中(使用的是toolbox的官方示例)

Expected Behavior

在排除指定组件后,所有关于该组件的都不显示

Environment

- OS:win7
- Browser:chrome 99
- Framework:vue 2.6.11

Any additional comments?

No response

@echarts-bot echarts-bot bot added pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Mar 14, 2022
@echarts-bot
Copy link

echarts-bot bot commented Mar 14, 2022

@life-as-flowers 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] When the excludeComponents of the saveAsImage option of the toolbox excludes the toolbox, the title of the icon will still be drawn in the figure

BODY

Version

5.3.0

Link to Minimal Reproduction

No response

Steps to Reproduce

let option = {
toolbox: {
show: true,
feature: {
dataZoom: {
yAxisIndex: "none"
},
dataView: {
readOnly: false
},
magicType: {
type: ["line", "bar"]
},
restore: {},
saveAsImage: {
excludeComponents: ["toolbox"] // After excluding the toolbox component, the title of the component's icon will still be generated in the figure
},
}
},
xAxis: {
type: "category",
boundaryGap: false,
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
},
yAxis: {
type: "value",
axisLabel: {
formatter: "{value} °C"
}
},
series: [{
name: "Maximum temperature",
type: "line",
data: [11, 11, 15, 13, 12, 13, 10],
markPoint: {
data: [{
type: "max",
name: "Max"
}, {
type: "min",
name: "Min"
}]
},
markLine: {
data: [{
type: "average",
name: "Avg"
}]
}
}, {
name: "Minimum temperature",
type: "line",
data: [1, -2, 2, 5, 3, 2, 0],
markPoint: {
data: [{
name: "Week Minimum",
value: -2,
xAxis: 1,
yAxis: -1.5
}]
},
markLine: {
data: [{
type: "average",
name: "Avg"
},
[{
symbol: "none",
x: "90%",
yAxis: "max"
}, {
symbol: "circle",
label: {
position: "start",
formatter: "Max"
},
type: "max",
name: "Top"
}]
]
}
}]
};

export default option;

Current Behavior

When the excludeComponents of the saveAsImage option of the toolbox excludes the toolbox, the title of the icon will still be drawn in the figure (using the official example of the toolbox)

Expected Behavior

After excluding the specified component, all information about the component is not displayed

Environment

- OS: win7
- Browser:chrome 99
- Framework: vue 2.6.11

Any additional comments?

No response

@plainheart
Copy link
Member

是不是开启了脏矩形渲染?

@life-as-flowers
Copy link
Author

@plainheart 是的,我关闭脏矩形渲染后就好了,感谢您的帮助,关于脏矩形之前没认真了解,我再去看看。然后关于echarts的文档,有些建议:
1、有些元素类似于html的盒模型,希望能使用图例直接标识出关于一个块的每个位置对应的字段,有助于加快学习,加深印象,更加形象;
2、之前有感触,暂时想不起来了,有机会再提出;

@plainheart
Copy link
Member

@life-as-flowers 对于建议1,我们提供了有术语速查手册

@life-as-flowers
Copy link
Author

@plainheart 这是个很好的功能。关于toolbox的title,我发现是绘制在canvas里的,这样的话title容易越界,显示不全,我们是否能做成tooltip那样,以div绝对定位去显示呢?这样既可以解决脏矩形渲染时,排除toolbox时,title会被包括进去,又可以解决title的越界显示问题

@life-as-flowers
Copy link
Author

@plainheart 你好,关于toolbox的title,我发现是绘制在canvas里的,这样的话title容易越界,显示不全,我们是否能做成tooltip那样,以div绝对定位去显示呢?这样既可以解决脏矩形渲染时,排除toolbox时,title会被包括进去的问题,又可以解决title的越界显示问题

@plainheart
Copy link
Member

你是说最右侧的 toolbox 的 title 显示不全么?那是个 bug,暂时还没修复。html 渲染现在暂不支持。

@life-as-flowers
Copy link
Author

是的,在右侧时会显示不全。期望后续版本能做优化,支持html渲染,感谢解答。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants