在nvd3.js lineWithFocusChart中设置'focus'区域 [英] Set 'focus' area in nvd3.js lineWithFocusChart

查看:173
本文介绍了在nvd3.js lineWithFocusChart中设置'focus'区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的lineWithFocusChart.js模型显示在nvd3示例如下所示: http:// nvd3 .org / ghpages / examples.html

I'm usuing the lineWithFocusChart.js model shown in the nvd3 examples shown here: http://nvd3.org/ghpages/examples.html

我想为图形选择特定的x范围,以便在载入时关注。我想在图表中有一个变量,我可以设置来完成这个。

I want to be able to choose a specific x range for the graph to be focused on at load. I thought there would be a variable in chart that I could set to accomplish this.

推荐答案

页面上:

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

感谢@ elsherbini的评论。

Thank @elsherbini's comment.

这篇关于在nvd3.js lineWithFocusChart中设置'focus'区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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