javascript - How to resize an nvd3 chart when the window resizes? -


i've created population pyramid in nvd3, it's not resizing it's supposed to, , cannot diagnose why. here's pen problematic code: http://codepen.io/laissezpasser/pen/qnrpxq

for comparison, here's working example of responsiveness i'm trying achieve in pen above: try [resizing 1 of windowpanes in pen: http://codepen.io/laissezpasser/pen/jrbgqg reason, seems ignoring following code:

nv.utils.windowresize(chart.update); return chart;  

your code broken, pay attention javascript console, have told errors...

// why line here, you've set data! d3.select('#chart svg')   .datum(data()) //<-- data not defined   .transition().duration(500).call(chart);  // why line here, interactivelayer not defined! interactivelayer.tooltip   .headerformatter(function(d, i) {     return nv.models.axis().tickformat(',')(d,i);   }) 

removing these offending lines, fixes issue.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -