Skip to content

echarts 4.0 树缩放 后收拢根节点会玩失踪 #9256

@020cui

Description

@020cui

One-line summary [问题简述]

前置条件:
1,当树的配置 启用了内部缩放,与拖动
2,视图中拖动过树,(或做过缩放动作)

对根节点进行收缩处理,根节点会向树根反方向飘移一个较大的距离,
根节点在边缘的话,就会看不见树,(树跨界了)且没办法找到树,

临时解决办法:只能重置或刷新页面

Version & Environment [版本及环境]

  • ECharts version [4.0]:
  • Browser version [浏览器类型和版本]:
  • OS Version [操作系统类型和版本]:

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

myChart.showLoading();
$.get('data/asset/data/flare.json', function (data) {
myChart.hideLoading();

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

            data: [data],

            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
        }
    ]
});

});

option = {

}

Other comments [其他信息]

http://www.echartsjs.com/gallery/editor.html?c=tree-vertical

image

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions