Search code examples
d3.jspie-chartc3

How to remove cursor pointer from d3 Pie chart


Is there an option that disables the "cursor: pointer" style from the c3|d3 pie chart? I simply display slices and on hover just show the % percentage and a label, do not need the pointer because it is misunderstood as a link to somewhere, yet it is the default cursor...

Update 1: I found a workaround, but it does not answer my question..

onrendered: function () { $('#my_chart_id .c3-shape').css('cursor', 'default'); }

Solution

  • I think the most straight-forward thing to do would be to use D3 to select each arc of the pie and change the cursor style, like this:

    d3.selectAll(".c3-arc").style("cursor", "auto");
    

    Fiddle here: http://jsfiddle.net/henbox/k9Dbf/270/

    Cursor style options here: http://www.w3schools.com/cssref/pr_class_cursor.asp