在nvd3.js lineWithFocusChart中设置'focus'区域

Cha*_*nka 10 javascript d3.js nvd3.js

我正在使用此处显示的nvd3示例中显示的lineWithFocusChart.js模型:http://nvd3.org/ghpages/examples.html

我希望能够为负载时要关注的图形选择特定的x范围.我以为图表中会有一个变量,我可以设置完成此任务.

yeg*_*gle 12

假设页面上只有一个由nvd3生成的图形:

chart = nv.graphs[0] // how to choose the graph by DOM id?
chart.brushExtent([10,20])
chart.update()
Run Code Online (Sandbox Code Playgroud)

感谢@ elsherbini的评论.