Skip to content

树图 配置leaves--label--formatter失效 #8534

@fwfm

Description

@fwfm

One-line summary [问题简述]

只有在配置系列下的label属性时,formatter才会生效,如果加在leaves--label内,没有任何效果。如果formatter直接加在系列下的label属性中时,树的根结点的值是undefined。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: ECharts4.1.0
  • Browser version [浏览器类型和版本]:火狐浏览器
  • OS Version [操作系统类型和版本]:Win7

Expected behaviour [期望结果]

配置leaves--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,
                        formatter: '{b}   {c}'
                    }
                },

                leaves: {
                    label: {
                        normal: {
                            position: 'right',
                            verticalAlign: 'middle',
                            align: 'left',
                            formatter: '{b}   {c}'
                        }
                    }
                },

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

000

Other comments [其他信息]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions