对不起。我只会说很少的英语。
HTML:
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
使用Javascript:
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Total Work'
},
xAxis: {
categories: ['2013', '2014', '2015', '2016', '2017']
},
yAxis: {
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
}
},
tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' + this.y + '<br/>' +
'Total: ' + this.point.stackTotal;
}
},
plotOptions: {
column: {
stacking: 'normal'
}
},
series: [{
name: 'B1',
data: [5, 3, 4, 7, 2],
stack: 'male'
}, {
name: 'B2',
data: [3, 4, 4, 2, 5],
stack: 'male'
}, {
name: 'B3',
data: [2, 5, 6, 2, 1],
stack: 'female'
}, {
name: 'B4',
data: [3, 0, 4, 4, 3],
stack: 'gay'
}]
});
我想B1,B2到列并将B3,B4转换成每个catagory的饼。
感谢所有方向
答案 0 :(得分:0)
您需要创建五个单独的系列,其类型为pie
,并使用center
数组设置其位置。
API参考:
http://api.highcharts.com/highcharts/series%3Cpie%3E.center
http://api.highcharts.com/highcharts/plotOptions.pie.size
http://api.highcharts.com/highcharts/plotOptions.pie.startAngle