javascript - dc.js month chart uneven spacing between bars -
i creating chart using dc.js , can see spacing between months different. notable between february , march because february has 28 days. how have spacing between months?
chart //dimensions .height(250) .margins({top: 10, right: 50, bottom: 25, left: 50}) //x-axis .x(d3.time.scale().domain(domain)) .round(d3.time.month.round) .xunits(d3.time.months) .elasticx(true) .xaxispadding(20) //left y-axis .yaxislabel('dollars') .elasticy(true) .renderhorizontalgridlines(true) // right y-axis .rightyaxislabel('quantity') //composition .compose(composition) .brushon(false) .xaxis().tickformat(d3.time.format('%b %y'));
i think forget set gap
magnitudechart.width(480) //you should set chart width .height(150) .margins({top: 10, right: 10, bottom: 20, left: 40}) .dimension(magvalue) .group(magvaluegroupcount) .transitionduration(500) .centerbar(true) .gap(65) //set gap .filter([3, 5]) .x(d3.scale.linear().domain([0.5, 7.5])) .elasticy(true) .xaxis().tickformat();
Comments
Post a Comment