我正試圖使用highcharts將其他數據添加到我的餅圖。 試圖解釋: 我的瀏覽器的餅圖:在Highcharts上向Pie Tooltip添加其他數據
- 火狐 - 10%
- 鉻 - 12%
- 資源管理器 - 65%
- 歌劇院 - 13%
我想添加更多信息以顯示在工具提示中: 例如:
- 火狐 - 10%其中女性用戶:5%
- 鉻 - 12%,其中的女人用戶:10%
- 瀏覽器 - 其中65%的女人用戶:30%
- 歌劇院 - 13%,其中女性用戶的:5%
我的推杆被髮明的價值觀,我想了解如何自定義工具提示,並添加一些更達ta系列。
我JsFiddle代碼
這是派我的JS代碼:
<script>
$(function() {
$('#container').highcharts({
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type:'pie'
},
title: {
text: 'Browsers'
},
subtitle: {
text:false,
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
series: [{
name: "Total",
colorByPoint: true,
data: [{
name: "Firefox",
y: 10,
}, {
name: "Chrome",
y: 12,
}, {
name: "Explorer",
y: 65,
}, {
name: "Opera",
y: 13,
}]
}],
});
});
</script>
感謝
update'pointFormat:'{series.name}:{point.percentage:.1f}其中女性用戶的百分比:{value}'' – Venugopal