echarts icon indicating copy to clipboard operation
echarts copied to clipboard

树形图叶节点label formatter无效

Open LiCasey opened this issue 8 years ago • 4 comments

One-line summary [问题简述]

树形图叶节点label formatter无效

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.8.5
  • Browser version [浏览器类型和版本]: Chrome 62.0.3202.94
  • OS Version [操作系统类型和版本]: Windows 10 x64

Expected behaviour [期望结果]

为树形图叶节点配置label formatter之后,叶节点的标签显示与其他节点不同

ECharts option [ECharts配置项]

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

                data: [data],

                top: '1%',
                left: '7%',
                bottom: '1%',
                right: '20%',

                symbolSize: 7,

                label: {
                    normal: {
                        position: 'left',
                        verticalAlign: 'middle',
                        align: 'right',
                        fontSize: 9
                    }
                },

                leaves: {
                    label: {
                        normal: {
                            position: 'right',
                            verticalAlign: 'middle',
                            align: 'left',
                            formatter: (value) =>{
                                return 'test label'
                            }
                        }
                    }
                },

                expandAndCollapse: true,
                animationDuration: 550,
                animationDurationUpdate: 750
            }
        ]
    }

Other comments [其他信息]

LiCasey avatar Dec 12 '17 03:12 LiCasey

@pissang 你好,我想请教一下,symbolSize这个参数现在是没有任何作用了么?现在应该用哪里来调节树形图中每个节点的大小呐?现在的那个默认大小,太小了,每次要移动鼠标到那么小的一个点上才能显示tooltip,这设计太难受了。 谢谢!

ponyfe avatar Dec 13 '17 07:12 ponyfe

您好好,我本地试了一下,是可以的。如下图,不仅可以修改所有 symbol 的大小,还可以指定单个symbol 的大小。等到下一个版本发布后,您再验证下。 image

deqingli avatar Apr 08 '18 06:04 deqingli

。。。。。。。牛头不对马嘴,好好看人家问题好吧 @LiCasey 我也碰到了

Devil0 avatar Mar 11 '19 01:03 Devil0

我也遇到这个问题了。。。。。官网的tree 图 label叶子 formatter 无效。。

goSunadeod avatar Oct 11 '19 09:10 goSunadeod