JQPlot - How do I change the cursor to a pointer to a Hover to Bar in JQPlot?

I want to change the cursor to "Pointer" when it hovers over the JQPlot panel.

I tried changing CSS. But that did not work. Please help me.

+5
source share
3 answers

You need to - as you tried - modify it using CSS. Perhaps you are not applying CSS change to the element you need, you need to apply it to .jqplot-event-canvas :

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

See working example here

Change . Script and code updated according to sdespont comment .

PS As written by Lucas Jelinek, you can override the default pointer when you dispute your data:

$('#chart1').on('jqplotDataUnhighlight', function() {
    $('.jqplot-event-canvas').css('cursor', 'auto');
});
+9

AnthonyLeGovic, , :

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

, :

$('#chart1').on('jqplotDataUnhighlight', function() {
    $('.jqplot-event-canvas').css('cursor', 'auto');
});
+2

.

:

cursor: {style: 'pointer', show: true, showTooltip: false}

But I want the cursor: "Pointer" to be displayed when it is on the panel, not in the entire area of ​​the chart.

+1
source

All Articles