oesmith/morris.js — pull request #149 by tiraeth (2012-12-31 14:06:15+00:00)
Title: New Donut chart and Pie chart

As in my previous PR, new version for these two folks. I've also added callbacks for ```hover``` and ```click``` events.

Currently only one series per donut chart but in future more series will be available to be put there. **These charts support 0-valued rows** by providing ```@options.minSectorAngle``` (in degrees) to be used as a minimum value for a sector.

Please mind that if ```minSectorAngle: 5``` then sectors with values ```0``` and ```3``` will have the same angle in the chart.

* Labels are displayed above the chart (```@options.showLabel = (true|false|"hover")```),
* You can define the draw-out radius using ```@options.drawOut``` (defaults to ```5```) which will affect outer (and inner in case of Donut) arc,
* You can define the sector ID key (```@options.idKey```) to identify clicked/hovered sectors in callbacks (you also get the whole data row extended with ```sector``` %-value and ```angle``` degree-value),
* Single row data is handled properly in each chart type,
* Uniform data set with zeros is also handled properly (i.e. 4 rows with zeros will get 4 equal quarters on chart).

![donut-chart](https://f.cloud.github.com/assets/52669/36588/805bd93e-5352-11e2-92fc-44ab388eb5cb.png) ![pie-chart](https://f.cloud.github.com/assets/52669/36589/84850ea4-5352-11e2-9c89-d1af2152ba91.png)

Hint: I am very seriously thinking about getting rid of the ```stroke``` parameter and handle the spacing between sectors with math instead of path's stroke.

PS. Sorry for two commits per PR. Forgot to rebase :cry: