Template:Stacked bar/doc

Usage
Makes a horizontal stacked chart of up to 12 counts (plus a gray bar if the total is greater than the sum of the 12). If no total is supplied, defaults to 100 (for percentages). By default, uses nice rainbow of colors that don't correspond to reserved article class or importance colors, but colors can be customized.

Article counts may be automatically calculated with the  magic word, e.g.


 * variables: Amounts. Given as any plain number. No units permitted.
 * variables: Optional titles. If no title is wanted, leave completely blank. (A &amp;nbsp; or similar is not helpful.)
 * variables: Optional colour values as any valid CSS colour. Defaults to a rainbow-type progression
 * Optional total amount. Given as any plain number. No units permitted. Defaults to 100.
 * Optional height of the bar. Given as a CSS length (px recommended). Defaults to 10.
 * : If set to yes/true, have the labels use vertical text. If set to lean, tilts the text at an angle.
 * : If the captions are vertical, their height is limited to this. Given as a CSS length, e.g. 8em or 200px.

{	"params": { "vertical_caption": { "label": "Vertical caption", "description": "If set to yes/true, have the labels use vertical text.", "type": "boolean" },		"caption_height": { "label": "Caption height limit", "description": "If the captions are vertical, their height is limited to this. Given as a CSS length.", "type": "string", "default": "8em" },		"height": { "label": "Bar height", "description": "Height of the bar as a CSS length (px recommended).", "type": "string", "default": "Default is 10px; this is as thin as you would want to go." },		"Total": { "label": "Total amount", "description": "Total amount that the bars sum to. Should be a number with no units.", "type": "number", "default": "Defaults to 100 so that percentages can be used as the amounts." },		"T1": { "label": "Text 1", "type": "line", "suggested": true, "description": "Label of this item" }, "A1": { "label": "Amount 1", "type": "number", "required": true, "description": "Amount of this item (plain number)" }, "T2": { "label": "Text 2", "type": "line", "suggested": true, "description": "Label of this item" }, "A2": { "label": "Amount 2", "type": "number", "required": true, "description": "Amount of this item (plain number)" }, "T3": { "label": "Text 3", "type": "line", "suggested": true, "description": "Label of this item" }, "A3": { "label": "Amount 3", "type": "number", "suggested": true, "description": "Amount of this item (plain number)" }, "T4": { "label": "Text 4", "type": "line", "description": "Label of this item" }, "A4": { "label": "Amount 4", "type": "number", "description": "Amount of this item (plain number)" }, "T5": { "label": "Text 5", "type": "line", "description": "Label of this item" }, "A5": { "label": "Amount 5", "type": "number", "description": "Amount of this item (plain number)" }, "T6": { "label": "Text 6", "type": "line", "description": "Label of this item" }, "A6": { "label": "Amount 6", "type": "number", "description": "Amount of this item (plain number)" }, "T7": { "label": "Text 7", "type": "line", "description": "Label of this item" }, "A7": { "label": "Amount 7", "type": "number", "description": "Amount of this item (plain number)" }, "T8": { "label": "Text 8", "type": "line", "description": "Label of this item" }, "A8": { "label": "Amount 8", "type": "number", "description": "Amount of this item (plain number)" }, "T9": { "label": "Text 9", "type": "line", "description": "Label of this item" }, "A9": { "label": "Amount 9", "type": "number", "description": "Amount of this item (plain number)" }, "T10": { "label": "Text 10", "type": "line", "description": "Label of this item" }, "A10": { "label": "Amount 10", "type": "number", "description": "Amount of this item (plain number)" }, "T11": { "label": "Text 11", "type": "line", "description": "Label of this item" }, "A11": { "label": "Amount 11", "type": "number", "description": "Amount of this item (plain number)" }, "T12": { "label": "Text 12", "type": "line", "description": "Label of this item" }, "A12": { "label": "Amount 12", "type": "number", "description": "Amount of this item (plain number)" }, "C1": { "label": "Colour 1", "type": "string", "description": "CSS colour of this item" }, "C2": { "label": "Colour 2", "type": "string", "description": "CSS colour of this item" }, "C3": { "label": "Colour 3", "type": "string", "description": "CSS colour of this item" }, "C4": { "label": "Colour 4", "type": "string", "description": "CSS colour of this item" }, "C5": { "label": "Colour 5", "type": "string", "description": "CSS colour of this item" }, "C6": { "label": "Colour 6", "type": "string", "description": "CSS colour of this item" }, "C7": { "label": "Colour 7", "type": "string", "description": "CSS colour of this item" }, "C8": { "label": "Colour 8", "type": "string", "description": "CSS colour of this item" }, "C9": { "label": "Colour 9", "type": "string", "description": "CSS colour of this item" }, "C10": { "label": "Colour 10", "type": "string", "description": "CSS colour of this item" }, "C11": { "label": "Colour 11", "type": "string", "description": "CSS colour of this item" }, "C12": { "label": "Colour 12", "type": "string", "description": "CSS colour of this item" } },	"description": "Makes a horizontal stacked chart of up to 12 counts (plus a gray bar if the total is greater than the sum of the 12). If no total is supplied, defaults to 100 (for percentages). By default, uses nice rainbow of colors that don't correspond to reserved article class or importance colors, but colors can be customized.\n\nArticle counts may be automatically calculated with the magic word, e.g. \n\n• A# variables: Amounts. Given as any plain number. No units permitted.\n• T# variables: Optional titles. If no title is wanted, leave completely blank. (An   or similar is not helpful.\n• C# variables: Optional colour values as any valid CSS colour. Defaults to a rainbow-type progression",	"format": "" }

Examples

 * Video game good articles by arbitrary category
 * Note that if the width of the bar section is narrower than the width of the lables, then the labels push each other out of the way, harming readability. The final section has also been given a specified color, while the rest are left at defaults.
 * Note that if the width of the bar section is narrower than the width of the lables, then the labels push each other out of the way, harming readability. The final section has also been given a specified color, while the rest are left at defaults.


 * Video game good articles with vertical text
 * This is slightly harder to read, but will allow all but the narrowest categories to line up properly.


 * Number of video game articles in the 70s and earlier by year with a higher total than the sum
 * Note that some labels are abbreviated to avoid displacement. Note also the gray area at the end, as the sum of the categories is less than the "Total" number.


 * Video game good articles by year
 * Note that some labels are skipped to avoid displacement


 * Leaning labels (vertical_caption=lean)
 * Leaning labels, with a thicker bar, placed inside of an image frame. Note the line break in the final caption.