Template:ChartColors/doc
| This is a documentation subpage for Template:ChartColors. It may contain usage information, categories and other content that is not part of the original template page. |
| File:Lua-Logo.svg | This template uses Lua: |
This template displays standard color palettes: Category20 and Plotter. These color palettes can be used for statistical diagrams.
To translate or review the translation of the module to your language, edit carefully Data:I18n/ChartColors.tab.
Syntax
[edit source]{{ChartColors|color palette|number of colors|show the color number}}
Full color of diagram palettes. Moving the mouse cursor over each box the color number appears.
| Palette | Code | Resulting colors | Note |
|---|---|---|---|
| Category20 (When n > 10) |
{{ChartColors|Categ20|20}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | Normal order |
{{ChartColors|Categ20_3|20}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | The first color is the 3rd | |
{{ChartColors|Categ20_i_3|20}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | Inverted order | |
| Category10 (Categ20 in the code. When n < 11) |
{{ChartColors|Categ20|10}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | Normal order (1st, 3rd, 5th, ... of Category20) |
{{ChartColors|Categ20_2|10}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | The first color is the 2nd (of Category20) | |
{{ChartColors|Categ20_3|10}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | The first color is the 3rd (of Category20) | |
{{ChartColors|Categ20_i|10}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | Inverted order | |
| Plotter | {{ChartColors|Plotter|26}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | Normal order |
{{ChartColors|Plotter_i|26}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. | Inverted order |
The number of colors must be from 1 to 20 (Categ20) or 26 (Plotter).
Show the color number is an optional parameter, with two values: '-' the color number and 'a' with the degree of transparency (alpha channel) added at the end of the number and always it will be 'ff'. It is only interesting to add the color for the map coloring.
Template data
[edit source]TemplateData for ChartColors
Show colors of two standard palettes
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Palette name | 1 | Name of the palette to use | Line | required |
| Number of colors | 2 | The number of colors to show on the palette, from 1 to 20 (Categ20) or 26 (Plotter) | Number | required |
| Show color number | 3 | Write the color number after the box: - (only number) or (with alpha channel) | Number | optional |
Examples
[edit source]| Code | Result |
|---|---|
{{ChartColors|Categ20|10}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. |
{{ChartColors|Categ20|20}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. |
{{ChartColors|Plotter|20}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. |
{{ChartColors|Categ20|3|-}} |
Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/ComplForColorModules.tab. |
See also
[edit source]- {{BrewerColors}}