d3 - Scaling @ Normalized Stacked Bar Chart <p>I want to code a reusable chart in d3 - a "normalized" stacked bar chart. The data are scaled from 0% -100% on the Y-axis - see: <a href="http://bl.ocks.org/mbostock/3886394" rel="nofollow">http://bl.ocks.org/mbostock/3886394</a> I have understood that I need to calculate the inverse value of the data, to scale from 0 (Y: lowest value 0%) to 1 (Y: highest value 100%). </p> <pre><code>var y = d3.scale.linear() .range([height, 0]); // no data domain dataSet = dataSet.map(function (d) { return d.map(function (p, i) { return { x: i, y: (1 / (p.Value / 100))}; }); }); </code></pre> <p>However, my scaling is not working correctly </p> <ul> <li>please have a look @ <a href="http://jsfiddle.net/dB96T/1/" rel="nofollow">http://jsfiddle.net/dB96T/1/</a></li> </ul> <p>thx!!</p>