i'm facing with an issue where in d3 bar chart is getting generated outside div region on each selectpicker selection.
var svg = d3.select("#barchart").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
Full blown code can be found at the below jsbin location
http://jsbin.com/sodivamiqa/edit?html,js,output
Month,Success_Count,Failure_Count
Dec,32,12
Jan,35,5
Feb,5,2
March,40,2
April,30,25
May,12,10
Output Image
100% will keep it inside the div.
var svg = d3.select("#barchart").append("svg")
.attr("width",'100%')
.attr("height", '100%')
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With