d3pie
d3pie copied to clipboard
It is no responsive.
@Avinash929 What behavior would you expect? Can you elaborate?
I agree, some responsive behavior would be amazing. I can set the svg and containing element to resize proportionately, but the svg paths inside do not.
Trying to figure out why that is, since charts generated from c3.js can be made responsive fairly easily. I suspect something maybe to do with viewbox positioning but really not sure.
Replace line no. 257 from addSVGSpace
method of helpers
object
var svg = d3.select(element).append("svg:svg")
.attr("width", canvasWidth)
.attr("height", canvasHeight);
with below code.
var svg = d3.select(element).append("svg:svg")
.attr("width", "100%")
.attr("height", "100% ")
.attr('viewBox','0 0 '+canvasWidth+' '+canvasHeight);
It worked for me.