Could not add a speedometer(d3.js) into slide box

Hey guys, I was trying to add a speedometer into a slide box provided here:

The code is implemented as follow:

    <ion-slide-box>
      <ion-slide>
    <div style=" height: 300px;border: 1px dashed black"><span id=speedometer></span></div>
      </ion-slide>
      <ion-slide>
        <div style=" height: 300px;border: 1px dashed black"></div>
      </ion-slide>
    </ion-slide-box>

The whole thing will crash and receive error (TypeError: Cannot read property ‘each’ of undefined)

However, if I put the speedometer out of the ion-slide-box, everything will works fine. However, I want it to stay in the slide box. Is there anyway to solve this problem?