Enhance Pie plot with several features and layout improvements.



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.

Because I cloned an existing test set and didn't feel like rewriting it and
all the existing pie tests in AMD.

Sincerely,
-- Jared Jurkiewicz


On Thu, Jul 17, 2014 at 4:45 PM, Dylan Schiemann <notifications@github.com>
wrote:

> In charting/tests/test_pie2d_innerRadius.html:
>
> > +<![endif]-->
> > +<![if gte IE 9]>
> > +<!DOCTYPE HTML>
> > +<html lang="en">
> > +	<head>
> > +<![endif]>
> > +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> > +<title>Pie 2D</title>
> > +<style type="text/css">
> > +	@import "../../../dojo/resources/dojo.css";
> > +	@import "../../../dijit/tests/css/dijitTests.css";
> > +</style>
> > +<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true"></script>
> > +<script type="text/javascript">
> > +
> > +dojo.require("dojox.charting.Chart");
>
> Why are we adding new tests that don't use AMD?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dojo/dojox/pull/125/files#r15082862>.
>