Module:Piechart/doc

Smooth piechart module.

Usage
Draws charts in HTML with an accessible legend (optional). A list of all features is in the "TODO" section of the main `p.pie` function.

Most of the time you should use with a helper template that adds required CSS: Piechart.

Labels and Legend
Here we add some custom labels. Also note that we add a meta option to add legend on the side.

Automatic Scaling
In cases where you don't have calculated percentages, you can use automatic scaling. Just provide both values in this case.

Multiple Values
The module allows displaying multiple values, not just 2.

Note that in this case, it was necessary to provide the additional option. This is necessary when the sum is less than 100.

Legend and Its Position
The legend is added using the meta property legend as shown. However, you can also change the order using direction. Possible values include:
 * row (default) – order is list, chart;
 * row-reverse – reverse order, i.e., chart, list;
 * column – column layout (vertical).
 * column-reverse – column layout, reversed (chart on top).

row (default direction)

row-reverse

column

column-reverse

Green frames added for clarity in examples. They are not normally added.

Direct functions
In case you want to use without the Piechart template, you can use this main functions:

Note that direct calls to the pie function require adding CSS:

Example of json_data:
 * Note that the last value is missing. The last value is optional as long as the values are intended to sum up to 100 (as in 100%).
 * Notice  label, this is a formatted number (see ` `).
 * Colors are hex or names. Default palette is in shades of green.

Example of meta=json_options:

All meta options are optional (see ` `).

Feature requests
For feature requests and bugs write to me, the author of the piecharte module: Maciej Nux.