2

是否有一个选项可以禁用 c3|d3 饼图中的“光标:指针”样式?我只是显示切片,悬停时只显示百分比和标签,不需要指针,因为它被误解为指向某个地方的链接,但它是默认光标......

更新 1:我找到了一种解决方法,但它没有回答我的问题..

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

3 回答 3

2

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

于 2015-05-05T13:13:39.273 回答
2

通过 CSS 覆盖:

.c3-shape {
  cursor: default !important;
}
于 2019-03-04T00:02:14.757 回答
0

我使用了针对所有(我们的)c3 实例的 css 覆盖:

.c3-event-rect {
  cursor: default !important;
}
于 2019-12-09T15:42:25.860 回答