Closed marcusnovotny closed 8 years ago
var chart1 = new characterChart(d3.select("#chart1"), "/d4/csv/" + name1 + ".csv"); /*eslint no-undef:0*/
d3.select(window).on('resize', chart1.resize);/*eslint no-undef:0*/
var chart2 = new characterChart(d3.select("#chart2"), "/d4/csv/" + name2 + ".csv"); /*eslint no-undef:0*/
d3.select(window).on('resize', chart2.resize);/*eslint no-undef:0*/
That won't work because you can only specify one dom event handler per event. Make it
d3.select(window).on('resize', function(){ chart1.resize; chart2.resize;}
Thanks, I'll try it! :)
Tell me if it's not working, I had it running once already :smile:
Only the right graph gets resized, the left one is simply overshadowed.
The function
d3.select(window).on('resize', function(){ . . . });
has to resize both chartsExtreme example: