Skip to content Skip to sidebar Skip to footer

Nvd3 Chart Responsive Issue

NVD3 Responsive issue I have code from my second page where I used the exactly same chart like here. But on that page it is responsive and I am trying to figure out why the chart i

Solution 1:

You need to call chart.update() when your slideToggle function finishes to make nvd3 redraw the chart to the new dimensions.

I.e.:

$('#chart').slideToggle(function() {
    chart.update();
});

Solution 2:

I used the .animate function.

    $("#slide").click(function () {
      if ($('.slide1').hasClass('showtable')) {
          $('.slide1.showtable').animate({height: 300}, 500).removeClass('showtable');
      } else { 
          $('.slide1').animate({height: 0}, 500)
          $('.slide1').addClass('showtable');
      }
    });
.slide1 {
    position: relative;
    width: 100%;
    overflow: hidden;
    right: 25px;
}

.slide1.showtable {
    height: 0;
}

Post a Comment for "Nvd3 Chart Responsive Issue"