dc.js - DC dynamic bar chart X-axis -


i'm trying create dynamic bar chart. space between bars not getting changed. here code , snapshots. plz me solving it. in advance.

chart                 .width(1000)                 .height(480)                 .brushon(false)                 .elasticx(true)                 .yaxislabel("this y axis!")                 .barpadding(0.5) 

here x axis onchange code. have added drop down it.

$("#x").on("change", function(){                 xaxis = ndx.dimension(dc.pluck($(this).val()));                 chart.dimension(xaxis)                 .x(d3.scale.ordinal())                 .xunits(dc.units.ordinal)                 if(yaxis!= null)                 {                     yaxis =  xaxis.group().reducecount(dc.pluck($("#y").val()));                     chart.group(yaxis);                     chart.elasticy(true);                     chart.effectivewidth();                     chart.render();                 }             }); 

enter image description hereenter image description here


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -