Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fwfm opened this issue Jun 18, 2018 · 2 comments
Closed

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

fwfm opened this issue Jun 18, 2018 · 2 comments

Comments

@fwfm
Copy link

fwfm commented Jun 18, 2018

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 [其他信息]

@pissang pissang added the pending We are not sure about whether this is a bug/new feature. label Jun 20, 2018
@deqingli
Copy link
Member

#11385

@deqingli deqingli added bug topic: tree duplicate and removed pending We are not sure about whether this is a bug/new feature. labels Oct 29, 2019
deqingli added a commit to deqingli/incubator-echarts that referenced this issue Nov 4, 2019
@deqingli
Copy link
Member

deqingli commented Nov 4, 2019

The value of the root is undefined because the root hasn't bee set any value and the following is work:

data: [{
    name: 'aaa',
    value: 111
}]

deqingli added a commit that referenced this issue Nov 6, 2019
fix tree diagram leaves label formatter don't work #11385 #8534
@deqingli deqingli closed this as completed Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants