Backbone.js보기의 일부로 jqplot 차트가 있습니다. 차트와 데이터는 모두 잘로드되지만 마우스 강조 표시와 차트를 클릭하면 등록되지 않은 것 같습니다. jqplot 예제에서 잘 작동합니다. Backbone.js 프레임 워크에 추가 할 때만 작동을 멈 춥니 다. 나는 "jqplotDataHighlight"와 "jqplotClick"그들 중 어느 이벤트를 트리거를 사용하여 시도jqplot이 backbone.js보기에서 "jqplotDataClick"이벤트를 트리거하지 않음
, 그러나 "jqplotDataUnhighlight는"잘 작동합니다. 나는 왜 하나가 작동하고 다른 하나는 작동하지 않는지를 알 수 없다.
//part of Backbone.js View....
var l2 = [11, 9, 5, 12, 14];
var l3 = [4, 8, 5, 3, 6];
var l4 = [12, 6, 13, 11, 2];
//this event never triggers
this.$('#plot3').bind('jqplotDataHighlight',
function (ev, seriesIndex, pointIndex, data) {
alert('highlight');
$('#info1b').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
});
//unhighlight event work just as expected
this.$('#plot3').bind('jqplotDataUnhighlight',
function (ev) {
alert("this worked: unhighlight")
$('#info1b').html('Nothing');
});
//chart load fine, showing all data
this.$('#plot3').jqplot([l2, l3, l4],{
stackSeries: true,
showMarker: false,
seriesDefaults: {
fill: true
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ["Mon", "Tue", "Wed", "Thr", "Fri"]
}
}
});
});