All examples By author By category About

llad

Reusable D3 column chart that supports negative values

See in action /llad/3766585

This simple column chart shows how to handle negative values on the y axis. It handles ordinal values for the X axis only.

I started with this gist from Mike Bostock: https://gist.github.com/2368837 see it on blocks: /mbostock/2368837

borrowed a bit from the histogram example in D3: https://github.com/mbostock/d3/tree/master/examples/histogram

and used the reusable chart convention from: http://bost.ocks.org/mike/chart/