我有問題單擊Kendo條形圖(seriesClick)上的事件。我沒有定義。以前,我喜歡e.category及其作品,因爲categoryAxis:不在數組中。但是現在我的代碼categoryAxis:在數組中以避免與條形圖重疊標籤。實際上,如果arrayAxis在數組中,我該如何調用。下面是我的腳本:Kendo UI條形圖類別在系列中未定義單擊事件
var series = [{
"name": "Total",
"colorField": "valueColor",
"gap": 0.5,
"data": [{value: aa, valueColor: "#ff0000"},{value: bb, valueColor: "#9966ff"},{value: cc, valueColor: "#66ff66"},{value: dd, valueColor: "#ffff00"},
{value: ee, valueColor: "#ff8080"},{value: ff, valueColor: "#ff9933"},{value: gg, valueColor: "#ccccb3"},{value: hh, valueColor: "#4dffff"}]
}];
$("#chart_div2").kendoChart({
title: {
text: "Emotion Result"
},
legend: {
visible: false
},
seriesDefaults: {
type: "bar",
height: 150
},
series: series,
valueAxis: {
line: {
visible: false
},
minorGridLines: {
visible: true
},
axisCrossingValue: [0, -Infinity]
},
categoryAxis: [{
labels:{
visible:false
}
},{
categories: ["Anger", "Calm(+)/Agitated(-)", "Fear", "Happy(+)/Sad(-)", "Like(+)/Dislike(-)", "Shame", "Sure(+)/Unsure(-)", "Surprise"],
majorGridLines: {
visible: false
}
}],
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
},
seriesClick: function(e){
var emo=e.category;
alert("You Click : "+emo)
clickBar(emo);
}
});
謝謝你幫
我已經測試過這個腳本,它按預期工作。非常感謝@ezanker – N85