Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
SP500.csv
bars.css
makepackedbars.js
packedbars.html

README.md

D3 implementation of Packed Bars chart

Simple usage:

<link rel="stylesheet" href="bars.css"/>
<svg width="960" height="500"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="makepackedbars.js"></script>
<script>
    makePackedBars({ csvFile: "sp500.csv" });
</script>

Fancier usage:

<link rel="stylesheet" href="bars.css"/>
<svg width="960" height="500"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="makepackedbars.js"></script>
<script>
    makePackedBars({
        csvFile: "sp500.csv",
        nPrimary: 15,
        valueTitle: "Market Capitalization in $billions",
        chartTitle: "S&P 500 Market Caps",
        chartMargin: {top: 30, right: 20, bottom: 50, left: 20},
        labelThreshold: 0.6 // threshold for labeling secondary bars
    });
</script>