JQPlot - 如何在JQPlot中将光标更改为指向Hover to Bar?

Man*_*ish 5 jqplot

我想将光标悬停在JQPlot的Bar上时将其更改为'Pointer'.

我试图改变CSS.但它没有用.请帮我.

Ant*_*vic 9

您需要 - 正如您所尝试的那样 - 使用CSS修改它.您可能没有在正确的元素上应用CSS更改,您需要将其应用于.jqplot-event-canvas:

$('#chart1').on('jqplotDataHighlight', function () {
   $('.jqplot-event-canvas').css( 'cursor', 'pointer' );
});
Run Code Online (Sandbox Code Playgroud)

在这里查看一个工作示例

根据sdespont的评论编辑小提琴和代码.

PS正如Lukas Jelinek所写,您可以在取消显示数据时重新定义默认指针:

$('#chart1').on('jqplotDataUnhighlight', function() {
    $('.jqplot-event-canvas').css('cursor', 'auto');
});
Run Code Online (Sandbox Code Playgroud)