树形展开缩放位置改变echarts tree配置项内容和展示

树形往下拖拽,点击最上面节点收缩后位置会往上偏移。 展开状态下往上拖拽,收缩后就跑出显示区域了。

配置项如下
      

    myChart.setOption(option = {
        tooltip: {
            trigger: 'item',
            triggerOn: 'mousemove'
        },
        series:[
            {
                type: 'tree',

                data: [{
                    name: 'test1',
                    children: [{
                        name: 'test2'
                    },{
                        name: 'test3'
                    },{
                        name: 'test4'
                    }]
                }],

                left: '2%',
                right: '2%',
                top: '8%',
                bottom: '20%',

                symbol: 'emptyCircle',

                orient: 'vertical',

                expandAndCollapse: true,
                roam: true,
                label: {
                    normal: {
                        position: 'top',
                        rotate: -90,
                        verticalAlign: 'middle',
                        align: 'right',
                        fontSize: 9
                    }
                },

                leaves: {
                    label: {
                        normal: {
                            position: 'bottom',
                            rotate: -90,
                            verticalAlign: 'middle',
                            align: 'left'
                        }
                    }
                },

                animationDurationUpdate: 750
            }
        ]
    });

    
截图如下