Closed fwfm closed 4 years ago
只有在配置系列下的label属性时,formatter才会生效,如果加在leaves--label内,没有任何效果。如果formatter直接加在系列下的label属性中时,树的根结点的值是undefined。
配置leaves--label的formatter生效
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 } ] }
The value of the root is undefined because the root hasn't bee set any value and the following is work:
value
undefined
data: [{ name: 'aaa', value: 111 }]
One-line summary [问题简述]
只有在配置系列下的label属性时,formatter才会生效,如果加在leaves--label内,没有任何效果。如果formatter直接加在系列下的label属性中时,树的根结点的值是undefined。
Version & Environment [版本及环境]
Expected behaviour [期望结果]
配置leaves--label的formatter生效
ECharts option [ECharts配置项]
Other comments [其他信息]