0
我試圖動態地將標籤添加到highcharts餅圖部分,但由於某種原因點擊事件似乎沒有觸發。任何想法我做錯了/如何獲得控制檯消息註銷?以下是我所關注的Highcharts documentation的鏈接。Highcharts點擊函數沒有被調用?
$('#genderChart').highcharts({
chart: {
marginTop: 0,
marginBottom: 73,
marginRight: 50,
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
events: {
click: (e) ->
console.log "click"
}
},
title: {
text: '',
style: {
fontSize: 10
}
},
tooltip: {
pointFormat: '<b>{point.percentage:.1f}%</b>'
},
credits: {
enabled: false
},
exporting: {
enabled: false
},
plotOptions: {
pie: {
size: 300,
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
series: [{
type: 'pie',
name: 'Gender Breakdown',
data: [
{
name: "Male",
y: male,
color: "#9A3334"
},
{
name: "Female",
y: female,
color: "#217C7E"
}
]
}]
})
'點擊:(E) - > 的console.log 「點擊」'這是什麼語言? – Brewal 2014-09-26 15:07:27
@Brewal [Coffeescript](http://coffeescript.org/) – Anton 2014-09-26 15:08:14
這是咖啡的腳本。它相當於 click:function(e){0} {0} {0} console.log「click」; } – 2014-09-26 15:08:25