Wiki source code of Chart Macro (Radeox)

Last modified by Vincent Massol on 2016/06/05 22:23

Show last authors
1 Creates a PNG/SVG chart image using data from a wiki table or another data source.
2
3 This macro is not so easy to use directly (it has really a lot of parameters) so there is a work-in-progress [[charting wizard>>Extension.Charting Plugin]]. For more samples see [[this special page>>Extension.Charting Samples]].
4
5 == Usage ==
6
7 see example
8
9 === Parameters definition ===
10
11 |=Name|=Optional|=Allowed values|=Default value|=Description
12 |type|false|area, bar, line, pie, time| |The type of chart
13 |source|false|map| |The data source used for the table
14 |//type//|false|table, object and objectid| |In the sequel we only consider the more common case of table data sources.
15 |//doc//|true|document name|current document|The document that contains the source table
16 |//table_number//|true|number|0 (first table)|The position of the table in the document. Numbering starts at 0 and only radeox tables are counted.
17 |//range//|true|* or of the form A4-C7|*|The part of the table that is charted
18 |//decimal_symbol//|true|char|period (.)|Usually comma (,) or period (.)
19 |//ignore_alpha//|true|boolean|false|Whether all illegal characters in the data are ignored instead of considered errors
20 |//has_header_row//|true|boolean|true|Whether the first row is a header and should be used to name series
21 |//has_header_column//|true|boolean|true|Whether the first column is a header and should be used to name series
22 |series|true|columns or rows|columns|Whether the series are organized on rows or on columns
23 |width|true|number|400|The width of the chart in pixels
24 |height|true|number|300|The height of the chart in pixels
25 |border_visible|true|boolean|false|
26 |anti_alias|true|boolean|true|Antialiasing
27
28 {{info}}
29 Entries in italic are possible keys in the preceding map parameter. The maps are semicolon (;) separated sequences of key-value pairs. The key and the value are separated by colon (:). For example "k1:v1;k2:v2;k3:v3" is a map with three entries.
30 {{/info}}
31
32 {{info}}
33 There are a lot of other parameters not used so often.
34 {{/info}}
35
36 == Example ==
37
38 {{code}}
39 {table}
40 Category | Sales ($)
41 Category 1 | 1000000
42 Category 2 | 500000
43 Category 3 | 500000
44 Total | = sum(B2:B4)
45 {table}
46
47 {chart:source=type:table;range:A1-B4|type=pie|title=pie in the sky}
48 {{/code}}
49
50 [[See more samples here>>Extension.Charting Samples]]
51
52 === Result ===
53
54 {{image reference=table.png/}}
55
56 {{image reference=pie.png/}}

Get Connected