andrei
andrei

Reputation: 8582

Events in d3 graphs

I'm using a line char from nvd3 http://nvd3.org/ghpages/lineWithFocus.html I want to customise the tooltip events (stop them from fading out when you hover out) and also add other events like click.

How can I add events and how can I select the points that have been plotted from a json document (ie click in a point triggers an event).

Thanks!

I know google is a thing, I have tried.

Upvotes: 0

Views: 99

Answers (1)

Lars Kotthoff
Lars Kotthoff

Reputation: 109232

NVD3 is unfortunately not very flexible when it comes to things like this. To customise the behaviour you've mentioned, you're much better off building your graph in pure D3. This will be a bit more difficult to start with, but will allow you to do everything you want quite easily afterwards.

A good place to start is probably this example. There are many more on the D3 website, including ones with interaction, tooltips etc.

Upvotes: 2

Related Questions