javascript - Dc.js - Row Chart with dynamic height -


i created row chart dc.js. i've got dynamic data, i've got multiple kind of data every time. now, problem row chart's height statica , svg compressed , unclear:

rowchart = dc.rowchart('#rowchart');  rowchart   .width(300)  .height(300)  .margins({ top: 20, left: 10, right: 10, bottom: 20 })  .group(barchartdimensiongroup)  .dimension(barchartdimension)  ... 

and i've got error:

error: invalid negative value attribute height="-4.894322420223788"

i found solution through @gordon:

 rowchart = dc.rowchart('#rowchart');  var heightrowchart=0;  heightrowchart = rowchartdimensiongroup.all().length;   tmprowchart /* dc.rowchart('#day-of-week-chart', 'chartgroup') */  .width(300)  .height(heightrowchart*30)  ... 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -