How to force the nvd3 chart timespan to stretch the width of the chart?

我怕爱的太早我们不能终老 提交于 2019-12-08 18:45:32

Just figured it out!

d3.select('#chart svg')
    .datum(res)
    .transition().duration(500)
    .call(chart);

chart.update();  // <- Needed to add this

// nv.utils.windowResize(chart.update);

The following line was completely useless: nv.utils.windowResize(chart.update);

I moved the chart.update out of that and apparently this is what was needed to trigger the timespan to stretch out.

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