Skip to content

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

@life-as-flowers

Description

@life-as-flowers

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions