stacking horizontal bars

http://stackoverflow.com/questions/9643002/how-can-i-display-stacked-barcharts-horizontally-in-flot

by ryleyb

HTML

<script src="http://flot.googlecode.com/svn/trunk/jquery.flot.js"></script>
<script src="http://flot.googlecode.com/svn/trunk/jquery.flot.stack.js"></script>
    <div id="placeholder" style="width:600px;height:300px;"></div>

JavaScript

var d1 = [];
    for (var i = 0; i <= 10; i += 1)
        d1.push([parseInt(Math.random() * 30),i]);


    var d2 = [];
    for (var i = 0; i <= 10; i += 1)
        d2.push([parseInt(Math.random() * 30),i]);

    var d3 = [];
    for (var i = 0; i <= 10; i += 1)
        d3.push([parseInt(Math.random() * 30),i]);
    
        $.plot($("#placeholder"), [ d1, d2, d3 ], {
            series: {
                stack: true,
                lines: { show:false },
                bars: { show: true, barWidth: 0.6, horizontal:true }
            }
        });