作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用此处显示的 nvd3 示例中显示的 lineWithFocusChart.js 模型:http://nvd3.org/examples/lineWithFocus.html
我希望能够访问用户在 brushExtent
中选择的值(稍微相关,请参阅 here )然后将焦点应用于所有其他 lineAndFocus 图表。
我可以为折线图部分这样做:
chart.lines.dispatch.on('elementClick.customNameSpace', function(e) {
console.log('click', e);
});
brushExtent
是否有类似的东西? ?
chart.brushExtent([10,20])
chart.update()
chart.dispatch.on('brush.update', function(b) {
console.log(b.extent[0], b.extent[1]);
});
最佳答案
做就是了:
chart.focus.dispatch.on('onBrush', function brushChanged(brushExtent) {
otherCharts.forEach((chart) => chart.brushExtent(brushExtent));
});
关于nvd3.js - nvd3 + lineAndFocus + BrushExtent(访问被点击的焦点部分),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23820608/
我正在使用此处显示的 nvd3 示例中显示的 lineWithFocusChart.js 模型:http://nvd3.org/examples/lineWithFocus.html 我希望能够访问用
我是一名优秀的程序员,十分优秀!