Skip to content

Treemap current state is lost with setOption #13643

@dirslashls

Description

@dirslashls

Version

5.0.0

Steps to reproduce

Use the following where I have setup a custom toolbox feature. After the treemap is rendered, drilldown and then click on the toolbox feature which invokes a trivial setOption. The treemap state is reset.

option = {
    toolbox: {
        feature: {
            myView: { 
                icon: 'path://M22,7H2V2h20V7z M22,9.5H2v5h20V9.5z M22,17H2v5h20V17z',
                onclick: () => myChart.setOption({toolbox: { show:true } })
            }
        } 
    },
    series: [{
        type: 'treemap',
        data: [{
            name: 'nodeA',            // First tree
            value: 10,
            children: [{
                name: 'nodeAa',       // First leaf of first tree
                value: 4
            }, {
                name: 'nodeAb',       // Second leaf of first tree
                value: 6
            }]
        }, {
            name: 'nodeB',            // Second tree
            value: 20,
            children: [{
                name: 'nodeBa',       // Son of first tree
                value: 20,
                children: [{
                    name: 'nodeBa1',  // Granson of first tree
                    value: 20
                }]
            }]
        }]
    }]
};

What is expected?

When setOption is used to merge non-state related options, the treemap state shouldn't be reset.

What is actually happening?

The treemap always resets back to the initial state.


Note that it is not required to have a custom toolbox feature. I just gave it for a quick example. In my case, the toolbox is hidden/shown when the mouse enters/leaves the chart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishstaleInactive for a long time. Will be closed in 7 days.waiting-for: community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions