Module:Chart/doc: Difference between revisions

Content deleted Content added
updated documentation
Line 110:
 
====Scale per group====
It is possible to show each of the groups using different scale and units:
 
<pre>
{{ #invoke:Chart | bar chart
| width = 800
| group 1 = 1500000 : 2500000 : 3500000
| group 2 = 200 : 5000 : 45000
| group 3 = 2000 : 5000 : 20000
| colors = red : blue : green
| group names = People : Cars : Average car cost
| x legends = 1920 : 1965 : 2002
| tooltip 2 = : There is no good data for number of cars in 1965. we use 5,000 as best estimate
| units prefix = : : $
| scale per group = 1
}}
</pre>
 
{{ #invoke:Chart | bar chart
| width = 800
| group 1 = 1500000 : 2500000 : 3500000
| group 2 = 200 : 5000 : 45000
| group 3 = 2000 : 5000 : 20000
| colors = red : blue : green
| group names = People : Cars : Average car cost
| x legends = 1920 : 1965 : 2002
| tooltip 2 = : There is no good data for number of cars in 1965. we use 5,000 as best estimate
| units prefix = : : $
| scale per group = 1
}}
 
Notice the "units prefix" field: we do not need prefix for the first 2 groups, so we use colons with no content. As whitespace is ignored, we could write "::$" instead of " : : $".
 
Also note the special tooltip for the "Cars" number for 1965.
 
 
This option has been disabled. It was rarely used and broke in the last code update.
Here is an example with large number of groups - mainly to test how it looks with large number of legends:
 
Line 272 ⟶ 239:
 
===Examples===
 
<pre>
{{#invoke:Chart|pie chart
| radius = 150
Line 285 ⟶ 252:
}}
 
Note that we can leave the color empty to use the default, but in order to add the link to "Pear",
we had to mark the parameter by adding an extra delimiter to mark the omitted color parameter
 
{{#invoke:ChartSandbox/Ita140188/chart2|pie chart
Also note that the values can be provided with "language specific" format (like 1,000),
or scientific notation like 6.4e5. In the legends, numbers will always be displayed in
language-adjusted mode (can look different if module imported to other wikis).
</pre>
{{#invoke:Chart|pie chart
| radius = 150
| slices =
Line 305 ⟶ 266:
 
 
An example for the alternative syntax with "slice 1", "slice 2" etc.
 
 
<pre>
{{#invoke:chart|pie chart
|radius= 200
Line 339 ⟶ 299:
| percent = true
}}
</pre>
 
{{#invoke:chartSandbox/Ita140188/chart2|pie chart
|radius= 200
|units suffix = _Units
Line 372 ⟶ 331:
| percent = true
}}
 
<includeonly>[[Category:Graph, chart and plot templates]]</includeonly>