0

I was trying to add a charts using Highcarts on a bootstrap carousel. I added just two charts and put it inside two different slider and when I run it, the first slide looks okay but when in the next slide, the width of the chart became small. I tried other workarounds available which I found in here but no joy.

HTML:

<div id="chart-slider" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
   <ol class="carousel-indicators">
      <li data-target="#chart-slider" data-slide-to="0" class="active"></li>
      <li data-target="#chart-slider" data-slide-to="1"></li>
   </ol>

   <!-- Wrapper for slides -->
   <div class="carousel-inner" role="listbox">
      <div class="item active">
      <div id="chart-two" class="chart-container"></div>
   </div>

   <div class="item" class="chart-container">
       <div id="chart-three"></div>
   </div>
  </div>

Community
  • 1
  • 1
claudios
  • 6,588
  • 8
  • 47
  • 90

1 Answers1

0

I would try to put the charts in simple plain HTML file, then embed it like an iframe in Bootstrap Carousel, for example:

<div class="carousel-inner" role="listbox">
      <div class="item active">
      <iframe src="your-chart1.html"></iframe>
      </div>
      <div class="item" class="chart-container">
      <iframe src="your-chart2.html"></iframe>
      </div>
</div>
Bud Damyanov
  • 30,171
  • 6
  • 44
  • 52