nvd3.js How to disable tooltips for one serie only

房东的猫 提交于 2019-12-11 04:56:04

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/23754188/nvd3-js-how-to-disable-tooltips-for-one-serie-only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!