我想绘制对称的多级饼图。请参阅组织层次结构示例:Here
我尝试了以下http://jsfiddle.net/amrutaJgtp/7r8eb5ms/7/
series: [{
type: "sunburst",
data: [{
id: '0.0'
}, {
id: '1.0',
parent: '0.0',
name: 'Consumer',
color: colors[1]
}, {
parent: '1.0',
name: 'Furniture',
value: 1
}, {
parent: '1.0',
name: 'Office Supplies',
value: 1
}, {
parent: '1.0',
name: 'Technology',
value: 1
}, {
id: '2.0',
name: 'Corporate',
parent: '0.0',
color: colors[2]
}, {
parent: '2.0',
name: 'Furniture',
value: 1
}, {
parent: '2.0',
name: 'Office Supplies',
value: 1
}, {
parent: '2.0',
name: 'Technology',
value: 1
}, {
id: '3.0',
name: 'Home office',
parent: '0.0',
color: colors[3]
}, {
parent: '3.0',
name: 'Furniture',
value: 1
}, {
parent: '3.0',
name: 'Office Supplies',
value: 1
}, {
parent: '3.0',
name: 'Technology',
value: 1
}, {
id: '4.0',
name: 'Small Business',
parent: '0.0',
color: colors[4]
}, {
parent: '4.0',
name: 'Office Supplies'
}, {
parent: '4.0',
name: 'Technology'
}],
观察不到“小型企业”类别。
当我没有定义任何数据值时,不会绘制旭日图。我希望所有类别的大小都是对称的。
有没有办法利用Highcharts旭日图实现对称的多层饼图?
最佳答案
根据需要,有多种选择。以下是四个可能的选项及其相应的 fiddle :
<强> Fiddle 1 :
<强> Fiddle 2 :
<强> Fiddle 3 :
<强> Fiddle 4 :
其中 3 个每个点都有一个附加参数:
tooltipIncluded: false
使用此格式化程序控制工具提示:
tooltip: {
formatter: function() {
if (this.point.tooltipIncluded) {
return 'The population of <b>' + this.point.name + '</b> is <b>' + this.point.value + '</b>';
} else {
return false;
}
}
}
关于javascript - Highcharts:是否可以绘制没有数据值的旭日图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46769531/