PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, April 23, 2022

[FIXED] How to remove cursor pointer from d3 Pie chart

 April 23, 2022     c3, d3.js, pie-chart     No comments   

Issue

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



Answered By - Henry S
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing