I have a PIE chart. And it works okay but I can't make it work to be responsive and resizable . I need it to be compatible for a mobile browser and Ipad etc.
<html>
<head></head>
<body>
<div id="pie"></div>
<button id="addData"> Add Data </button>
<script src="http://d3js.org/d3.v4.min.js" charset="utf-8"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
<script src="https://raw.githubusercontent.com/benkeen/d3pie/0.2.1/d3pie/d3pie.min.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>
var data = [
{ label: "1", value: 1 },
{ label: "2", value: 4 },
{ label: "3", value: 3 }
];
var pie = new d3pie("pie", {
data: {
content: data
}
});
</script>
</body>
</html>
I tried to wrap it to bootstrap but this doesn't make it fully resizable
How can I make it resizable depending on mobile device or desktop ?
(PS: I'm using an example from here https://dzone.com/articles/d3js-pie-charts-made-super-easy-d3pie)