Question

I have dojo bar chart. Onmouseover the bar i would like a hand cursor. I was trying something like this

chart1.connectToPlot("default",function(evt) {
   var type = evt.type;
   if(type == "onmouseover"){

   }

how do i get my mouse pointer to show as hand when i move it over the bar?

Was it helpful?

Solution

Try this, assuming you have a div in your html (the container of your chart), with id="chartNode" :

 chart.connectToPlot("default",function(evt) {
    var type = evt.type;
    if(type == "onmouseover") {
        dojo.style("chartNode", "cursor", "pointer");
    }
    else if(type == "onmouseout") {
        dojo.style("chartNode", "cursor", "default");
    }

});

OTHER TIPS

If you're using bar/column charts, you can possibly get away with the following CSS:

    g rect {
        cursor: pointer;
    }

This might not be an optimal solution, especially if you have other SVG elements on the page, you could risk your cursor being a pointer where you don't want it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top