JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://d3js.org/d3.v4.min.js"></script>
<body>
<div class="container-fluid">
<h1>Hi There</h1>
<p>D3-Bootstrap</p>
<div class="row">
<div class="col-md-6 col-xs-12 chart-total-users"></div>
<div class="col-md-6 col-xs-12 chart-time-spent"></div>
</div>
</div>
</body>
JavaScript
var width = $(".chart-time-spent").width(),
height = 250,
radius = Math.min(width, height) / 2,
legendPosY = (height / 2) - 20;