Improve/enhance Pie chart plot, fixes #18076

This is related to trac: https://bugs.dojotoolkit.org/ticket/18076
A lot of this work was done by Eugene Lazutkin(uhop) with additional work, tests, and merging performed by myself.

This submission adds the following:

1.)  Much improved handling of the smart (column) labels.  It will dynamically resize the Pie radius to fit all the labels now.  You no longer need to have to trial/error set the radius.  Label layout is much improved.

2.)  Much improved radius handling in general.  It will now try to maximize the usage of the space inside the chart area (max radius) unless otherwise specified.  This combined with the label improvements means you rarely need to set radius now to get a good-rendering pie.  You still can and it works as it always has, but dynamic is better.

3.)  Support for ring-style pie charts.   You can now set an innerRadius property on the Pie plot and it will use that to generate a ring style chart.  Positive values work as percentage of whole (dynamic sizing).  Negative values work as exact pixels (fixed size).  This may seem odd, but it avoid having to string process to extract % or the like and is more efficient.  In general percentages would be the likely use case as it stands so was made the common positive meaning.

4.)  Theme support for setting the pieInnerRadius.

5.)  minWidth support.   This is so that you can always keep some aspect of a slice visible, particularly if that slice is going to have hover effects, like a tooltip.   The default is 0, which means the feature is off and the Pie works as it always has.  But, with a positive value, it will now force any slice < that size to scale up to that size so you can always have a minimum dimension.  Yes, in theory this does skew pie plots a bit if enabled but it is also useful for many slices or conditions where you want even the smallest slice to show up and be hoverable.



Ack.  Sad I missed that.  Will correct.


On Thu, Jul 17, 2014 at 11:49 AM, Christophe Jolif <notifications@github.com
> wrote:

> In charting/plot2d/Pie.js:
>
> > @@ -88,9 +99,12 @@ define(["dojo/_base/lang", "dojo/_base/array" ,"dojo/_base/declare",
> >  			labelOffset:	20,
> >  			labelStyle:		"default",	// default/columns
> >  			htmlLabels:		true,		// use HTML to draw labels
> > -			radGrad:        "native",	// or "linear", or "fan"
> > -			fanSize:		5,			// maximum fan size in degrees
> > -			startAngle:     0			// start angle for slices in degrees
> > +			radGrad:       "native",	// or "linear", or "fan"
> > +			fanSize:		   5,			// maximum fan size in degrees
> > +			startAngle:    0,			// start angle for slices in degrees
> > +			innerRadius:	0,			// inner radius in pixels
> > +			minWidth:      0,			// minimal width of degenerated slices
> > +			zeroDataMessage: "",    // The message to display when there is no data, if provided by the user.
>
> trailing comma
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dojo/dojox/pull/121/files#r15065508>.
>