$(function () {
$('#container').highcharts({
chart: {
plotBackgroundColor: ‘’,
plotBorderWidth: ‘’,
plotShadow: false
},
title: {
text: 'Browser market shares'
},
tooltip: {
//饼图特有的属性配置
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,//为true时,鼠标点击相应部分时,会有动画移出
cursor: 'pointer',//鼠标移到饼图上时提示的图形
dataLabels: {//饼图各个部分的提示配置
enabled: true,//饼图周围有相应组成成分的数据提示
color: '#000000',//提示的字体颜色
connectorColor: '#000000',//连接线的颜色(数据和图形的连接线)
//这里的point表示的是series.data里的一个对象,类似于['Firefox', 45.0]
//point.percentage:.2f 表示占用的百分比,显示格式是2位的浮点小数
format: '<b>{point.name}</b>: {point.percentage:.2f} %'
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 35.0],
['IE', 36.8],
{
name: 'Chrome',
y: 11.8,
sliced: true,
selected: true
},
['Safari', 7.5],
['Opera', 7.2],
['Others', 1.7]
]
}]
});
});