C3.js - how to show a hand cursor on a histogram

In pie charts, c3js by default shows a hand cursor (pointer) when a piece of cake hangs. I would like to have the same behavior for every bar in the histogram. How to achieve this?

I tried the css below, but it shows the hand cursor even when you hover between 2 bars.

.c3-event-rect {
    cursor:pointer;
}

To clarify this, the jsfiddle example I would like to have a cursor pointer only on the elements of the panel, because only they are available for click.

+4
source share
2 answers

, . jsfiddle, ( ).

, .:)

tl; dr:

  • data: { selection: { enabled: true }, [...]
  • .c3-bar { cursor: pointer; }
+6

CSS

.c3-bar {
    pointer-events: auto !important;
}

, !important pointer-events: none, C3 .

+1

Source: https://habr.com/ru/post/1608448/


All Articles