В документации от ECharts для treemap.data.label.formatter
это объясняется следующим образом:
{@xxx}: the value of a dimension named'xxx', for example,{@product}refers the value of'product'` dimension。
Предположим, у меня есть данные, как показано ниже:
data: [
{
name: 'Region1',
children: [
{
name: 'Region1-Country1',
// Option 1; I can make this work by using `formatter: '{b} brand count => {@[1]}'`
value: [800, 8], //here, '1000' is $ spend and '8' is brand count
// Option 2
value: {'brand':8, 'value':800},
// Option 3
brand: 8,
label: {
show: true,
formatter: '{b} brand count => {@??}' // WHAT should I use after '@'?
},
children: [
{ name: 'Region1-Country1-Brand1', value: 200 },
{ name: 'Region1-Country1-Brand2', value: 500 },
]
},
{
name: 'Region1-Country2',
value: 500,
children: [
{ name: 'Region1-Country2-Brand1', value: 100 },
{ name: 'Region1-Country2-Brand2', value: 200 },
{ name: 'Region1-Country2-Brand3', value: 200 },
]
},
]
},
]
На основеПо объяснению в документации выше, как мне подготовить массив data
, чтобы я мог использовать formatter: '{b} brand count => {@brand}'
и показать Region1-Country1 brand count => 8
на нарисованной карте?