キーボードイベントをにバインドする方法はありjqPlot
ますか? 左矢印キーと右矢印キーのみを使用して、プロット上のポイントをホバリングしようとしています。また、各ポイントを強調表示する必要があります。
クリック、ダブルクリックなどの方法があることは知っています。
$('#chart1').bind('jqplotClick', function(ev, gridpos, datapos, neighbor) {
if (neighbor) {
}
});
シフトクリックも実装しました。
$('#chart1').bind('jqplotShiftClick', function(ev, gridpos, datapos, neighbor) {
if (neighbor) {
}
});
意味:
this.onClick = function(ev) {
// Event passed in is normalized and will have data attribute.
// Event passed out is unnormalized.
if (ev.shiftKey) {
var positions = getEventPosition(ev);
var p = ev.data.plot;
var neighbor = checkIntersection(positions.gridPos, p);
var evt = jQuery.Event('jqplotShiftClick');
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
$(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
} else {
var positions = getEventPosition(ev);
var p = ev.data.plot;
var neighbor = checkIntersection(positions.gridPos, p);
var evt = jQuery.Event('jqplotClick');
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
$(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
}
};
しかし、これらすべてにクリックが含まれています。実際にポイントを選択しなくても同じ効果を出せるようにしたいです。
何かアイデアがあれば教えてください。