方法:
$('#container').highcharts({
xAxis: {
},
series: {
//给每一个条目加点击事件
cursor:
'pointer'
,
events: {
click:
function
(e) { 在这里写事件 } }
}, credits: { enabled: false //禁用一下就可以(消除默认链接显示) } }) //也可以在highchart.js中 搜索credits;然后将enabled:false加上就可以在根目录里边禁用了
饼图颜色设置
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie',
backgroundColor: 'rgba(0,0,0,0)'
},
exporting: {
enabled: false
},
credits:{
enabled: false // 禁用版权信息
},
title: {
text: ''
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
colors:['#ff0000','#0000ff','#00ff00'], //更改饼图颜色
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
series: [{
name: 'Brands',
colorByPoint: true,
data: [{
name: 'Chrome',
y: 61.41,
sliced: true,
selected: true
}, {
name: 'Internet Explorer',
y: 11.84
}, {
name: 'Firefox',
y: 10.85
}]
}]
});