nvd3.js如何仅对一个意向禁用工具提示 [英] nvd3.js How to disable tooltips for one serie only

查看:111
本文介绍了nvd3.js如何仅对一个意向禁用工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试禁用图表的line系列的工具提示,并保留其中一个bar系列.我真的看不到我该怎么做.

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.

启用两个系列的工具提示时遇到的问题是,我看不到bar系列的工具提示,因为它总是从更接近的line中选择一个.如果鼠标靠近该点,也许可以触发工具提示?目前,它在距该点约10-20像素处触发它.

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.

推荐答案

这应该做到:

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

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

这篇关于nvd3.js如何仅对一个意向禁用工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆