maxwell2022
maxwell2022

Reputation: 2855

nvd3.js How to disable tooltips for one serie only

I'm trying to disable the tooltip for the line serie of my chart and leave the one of the bar serie. I can't really see how I can do it.

The problem I have with both series' tooltips enabled is that I cannot see the tooltip of the bar serie because it's always selecting the one from the line which is closer. Maybe it's possible to trigger the tooltip if the mouse is closer to the point? at the moment it's triggering it at around 10-20px away from the point.

enter image description here

Upvotes: 1

Views: 3247

Answers (1)

FernOfTheAndes
FernOfTheAndes

Reputation: 5015

This should do it:

var chart = nv.models.linePlusBarChart()
    .margin({top: 30, right: 60, bottom: 50, left: 70})
    ...
  ;

chart.lines.interactive(false) // add this line

Upvotes: 1

Related Questions