Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQPlot - How to change the cursor to pointer on Hover to Bar in JQPlot?

Tags:

jqplot

I want to change the cursor to 'Pointer' when it hover to Bar of the JQPlot.

I have tried to change in the CSS. But it didn't work. Please help me.

like image 843
Manish Avatar asked Apr 15 '13 05:04

Manish


1 Answers

You need - as you tried - to modify it using CSS. You maybe have not applying CSS change on the right element, you need to apply it to .jqplot-event-canvas :

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

Please see a working example here

Edit Fiddle and code updated according to sdespont's comment.

PS As written by Lukas Jelinek, you can redefine default pointer when you unhighlight your data :

$('#chart1').on('jqplotDataUnhighlight', function() {
    $('.jqplot-event-canvas').css('cursor', 'auto');
});
like image 137
AnthonyLeGovic Avatar answered Sep 23 '22 21:09

AnthonyLeGovic