问题描述
我试图控制“父母”的价值,而不管“孩子”如何 在TreeMap中。现在,当孩子拥有价值时会发生什么。 “父母”获得全部子女的价值。 即使当我给父母的价值。他没有提及。 我的问题是: 我如何给父母一个新的价值,使您可以独立于孩子而安排父母?
JsonInput:
const jsonData =[{
"name": "First","value": 20000,//Parent value
"children": [
{ "name": "A1","value": 100 },//children value
{ "name": "A2","value": 60 },//children value
{ "name": "A3","value": 30 } //children value
]
},{
"name": "Second","value": 140000,//Parent value
"children": [
{ "name": "B1","value": 135 },//children value
{ "name": "B2","value": 98 },//children value
{ "name": "B3","value": 56 } //children value
]
}]
代码:
const level1 = chart.seriestemplates.create("0");
let level1_column = level1.columns.template;
const level1_bullet = level1.bullets.push(new am4charts.LabelBullet());
level1_bullet.label.text = "{value}"; //The value is the sum of the values of all his children.
const level2 = chart.seriestemplates.create("1");
let level2_column = level2.columns.template;
const level2_bullet = level2.bullets.push(new am4charts.LabelBullet());
level2_bullet.label.text = "{value}"; //The value is of the child.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)