chart
Audit
- Macro ID
- chart
- Source
- XS
- Type
- Generator
- Classification reason
- The content can hold the data table, but the output is a chart image computed from it, and the data can also come from a table of another page.
- Status
- Reviewed
- Criteria version
- 15.20
- XWiki version
- 18.8.0
- Audit date
- 2026-10-19
- Auditor
- Compared macros
- liveData documents
Sources
Where to gather the information the criteria are checked against, see Gather the sources.
| Other sources specific to this macro |
|---|
|
| Criterion | Result | Notes |
|---|---|---|
| D1 wording | OK | "Chart" is the user's word for what the macro produces. |
| D2 summary | OK | the description, "Displays a graphical chart generated from miscellaneous data sources.", says what the macro adds, in 10 words. "Miscellaneous data sources" is vague, where it means a table in the macro content or a table of a page, but it is more than a repetition of the name. |
| D3 category | OK | in Content, like liveData and documents, the compared macros, and like ChartJS and Table to ChartJS, the other chart macros of the audit instance. |
| D4 quick-action | KO | Quick Actions finds the macro first for "chart" and "Chart", and for the French name "Graphique". The synonym "graph" ranks it 2nd, after Paragraph. The synonyms "plot", "pie" and "bar" do not find it: "pie" only lists jiraPieChart, "bar" only job, "plot" nothing. "diagram" lists the Diagram application macros and kroki, not chart, although the German name of the macro is "Diagramm". |
| L1 consistency | OK | compared with liveData and documents, two generators of the Content category that display data. Unlike them, chart has a mandatory parameter, type, so Quick Actions opens the Edit Macro dialog instead of inserting the macro right away. The difference is not by design, since a default type would work: it is counted under C2 of type, whose ticket covers it. Like them, the content is optional, and the defaults it declares, width and height, are shown in the dialog. |
| L2 doc-parameters | KO | the parameters are only documented on the legacy extensions.xwiki.org page, not in the new documentation. That page also lists colors as a parameter of the macro, while it is a key of params, as its own Custom Colors example shows: {{chart type="pie" params="range:B2-D5" colors="FF0000,00FF00,0000FF,000000"}} renders with the default colors and no message. It documents width and height as strings, where the macro declares integers, and the content only in the Usage section, not in the parameter table. |
| L3 doc-example | OK | the most common example is "Example for an "inline" data source Pie chart", {{chart type="pie" source="inline" params="range:B2-D5;series:columns;" title="Chart Test" width="320" height="240"}} with a table of 4 rows and 3 series as content, the same form as the 6 examples of the Help pages of XWiki Standard. It renders without error. The "Usage" blocks with placeholder values are templates, not examples, and the xdom examples need a page holding a table with an id, a setup step the documentation states. |
| I1 pattern | OK | Quick Actions and the Insert Macro dialog both open the Edit Macro dialog, since type is mandatory. This is the generic behavior of a macro with a mandatory parameter, see the C2 note of type. |
| I2 zero-config | OK | submitting the Edit Macro dialog with the default values does nothing, with no message, since type is required: the generic behavior of the dialog. {{chart type="pie"/}} renders "Failed to execute the [chart] macro. Cause: [Unable to find a matching data table.]", a configuration a generator may require. |
| I3 instant | N/A | |
| I4 cursor | N/A | |
| I5 focus | OK | type, the only mandatory parameter, comes first, above the Optional parameters tab, and has the focus. The range in params, without which the documented table fails, see the C3 note of params, is not mandatory. |
| E1 wysiwyg | OK | the editor shows the same chart image as view mode, inside the macro frame. |
| E2 errors | KO | most invalid values give a technical message that does not say what to type. Added to the most common example, source="foo" gives "Can't find descriptor for the component with type [interface org.xwiki.rendering.internal.macro.chart.source.DataSource] and hint [foo]". width="320px" , width="50%" and width="-5" give messages like "Width (0) and height (300) cannot be <= 0", which does not say that a number of pixels is expected. params="range:Z9-ZZ99;series:columns" gives "Index 8 out of bounds for length 5", params="range:B2-D5;series:columns;colors:zzz" gives "/ by zero", and a table without the range, params="garbage" or no params at all, gives "Invalid number: [].". params="range:B2-D5;series:columns;noSuchKey:1" is accepted silently. type="foo" gives "Invalid value for parameter [type]: [foo]", which names the parameter but not the accepted values, and type="Pie" fails the same way, the value being case sensitive. The messages for params="range:B2-D5;series:foo" , for width="5000" and for a page that does not exist are clear. |
| E3 nesting | OK | in a list item, in a table cell and in a box, like * {{chart type="pie" source="inline" params="range:B2-D5;series:columns;"}}...{{/chart}} , the chart renders and can be edited as at the top level. The content is a data table typed in wiki syntax in a dialog text area, so inserting a list or a box in it does not apply: both give "Unable to locate a suitable data table.", which is clear. A table with fewer columns than the range gives the technical message of E2. |
| E4 inline-support | OK | the macro declares inline support, and the most common example in a sentence, Before {{chart ...}}...{{/chart}} after. , renders the image inside the sentence, with no block element. |
| E5 empty | N/A | |
| E6 inplace | N/A |
Parameters
| Parameter | C1 clarity | C2 mandatory | C3 defaults | C4 input-assistance | C5 groups | C6 order | C7 alternatives | C8 advanced | C9 technical | C13 constraints | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| $content | KO | OK | N/A | KO | N/A | OK | N/A | N/A | N/A | N/A | C1: "Input data for the chart macro (e.g. for 'inline' source mode)" does not say what to type: a table in the syntax of the page, with a header row and a first column of labels, and which cells hold the data, see the range of params. "'inline' source mode" is a developer term. To reproduce: open the Edit Macro dialog from Quick Actions. C2: optional, since the data can come from a table of another page with source="xdom". C4: a plain text area, where the user has to type a table in wiki syntax, like |=|=X|=Y , from the WYSIWYG editor. A table editor, or editing the table in place next to the chart, could be used. C6: first in the Optional parameters tab, and set by the most common example. |
| height | KO | OK | OK | KO | OK | OK | N/A | OK | OK | KO | C1, minor: "The height of the generated chart image" does not give the unit, pixels, which the documentation states. C3: the field preselects the declared default, 300. The most common example sets 240, a value specific to that example: the examples of the Help pages of XWiki Standard keep the default. C4: a plain text field for a number of pixels. C13: a number, typed int, with no declared range, while only a positive number up to the limit of 2048 pixels of xwiki.properties is accepted: height="0" or height="abc" is accepted by the dialog and fails at rendering with "Width (400) and height (0) cannot be <= 0", and height="5000" with "Maximum chart width or height exceeded (limit is: [2048]x[2048]).". |
| params | KO | OK | KO | OK | OK | OK | OK | OK | OK | KO | C1: the label "Params" is an abbreviation of the ID, and the description, "Additional parameters for the data source", gives neither the format, key:value pairs separated by ";", nor the keys, range and series for a table, document and table for another page, and the colors and display options. Nothing says that the range is needed for the documented table, see C3. To reproduce: open the Edit Macro dialog from Quick Actions. C3: the field opens empty, which stands for the whole table, header row and label column included, and fails for the table of the most common example: {{chart type="pie"}} with that table renders "Invalid number: [].". The example needs range:B2-D5 , or range:B2-.. for the whole data, a value no field preselects. C4: a free text field for several settings in a dedicated syntax, like the parameters of jira. A custom picker for this mini-syntax would be overkill, so the text field is OK, as long as the description explains the syntax, which it does not, see C1. C7: the document and table keys are an alternative to the content, with source="xdom": only parameters can be part of a feature, see the Cross-macro findings. C13: a list of key:value pairs, with no declared format: params="range:B2-D5;series:columns;noSuchKey:1" is accepted and ignored, and params="garbage" fails at rendering with "Invalid number: [].". |
| source | KO | OK | KO | KO | OK | OK | OK | OK | OK | N/A | C1: "The string describing the type of input data source (e.g. xdom or inline)" uses developer terms, "string" and "xdom", the internal name of a table of another page, and does not say that an empty value picks inline when the macro has content and xdom otherwise. The "e.g." suggests other values while there are only two. To reproduce: open the Edit Macro dialog from Quick Actions. C3: the field opens empty, which stands for inline when the macro has content, the value of the most common example, so the example renders, but the field does not show which value it stands for. C4: a free text field, although the accepted values are inline and xdom: a select could be used. source="foo" is accepted and fails at rendering, see E2. C7: xdom, with the document and table keys of params, is an alternative to the content: only parameters can be part of a feature, see the Cross-macro findings. C13: the accepted values are a list rather than a format, so it is recorded N/A: the select of C4 would declare them. |
| title | OK | OK | OK | OK | OK | OK | N/A | OK | OK | N/A | C1: "The title of the chart (appears on top of the chart image)" says what it sets. It does not say that it is also the only text alternative of the image, see the notes of the macro. C3: the field opens empty, for no title, a sensible default: the title is specific to each chart. |
| type | OK | KO | N/A | KO | OK | OK | N/A | OK | OK | N/A | C1: the description, "The type of the chart (e.g. pie, line, area or bar)", says what it sets, and the field is labeled "Type". It lists 4 of the 12 accepted values, see C4. C2: mandatory, while a default type, like bar, would work for the table of the most common example and for any table of the documentation: {{chart params="range:B2-D5"}} with that table would give a chart instead of the error "Property [type] mandatory". Because of it, Quick Actions opens the Edit Macro dialog, see L1. C4: a free text field, although the accepted values are the 12 chart types, line, area, bar, stackedbar, bar3D, stackedbar3D, pie, line3D, xy_area, xy_line_and_shape, xy_line3D and xy_step: a select, ideally with a preview of each type, could be used. type="foo" and type="Pie" are accepted by the dialog and fail at rendering, see E2. C13: the accepted values are a list rather than a format, so it is recorded N/A: the select of C4 would declare them. |
| width | KO | OK | OK | KO | OK | OK | N/A | OK | OK | KO | C1, minor: "The width of the generated chart image" does not give the unit, pixels, which the documentation states. C3: the field preselects the declared default, 400. The most common example sets 320, a value specific to that example: the examples of the Help pages of XWiki Standard keep the default. C4: a plain text field for a number of pixels. The field is the last of the dialog, below the fold. C13: a number, typed int, with no declared range, while only a positive number up to the limit of 2048 pixels of xwiki.properties is accepted: width="320px" or width="50%" is accepted by the dialog and fails at rendering with "Width (0) and height (300) cannot be <= 0", width="-5" with "Width (-5) and height (300) cannot be <= 0", and width="5000" with "Maximum chart width or height exceeded (limit is: [2048]x[2048]).". |
Other notes
Without a title, the chart image has no text alternative: {{chart type="pie" params="range:B2-D5"}}...{{/chart}} renders an img element with no alt attribute, since the macro uses the title as the alt text. This is a bug outside the criteria, to file in JIRA.
The English names of the parameters are their IDs, "type", "params", "source", "title", "width" and "height", in ApplicationResources.properties, while French and German translate them; the dialog capitalizes them, so only "Params" reads as an ID, see its C1 note.
KOs and tickets
Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.
| KO | Criterion | Existing tickets | New tickets |
|---|---|---|---|
| D4 | D4 quick-action | XWIKI-25444 | |
| L2 | L2 doc-parameters | XINFRA-525 | |
| E2 | E2 errors | XCOMMONS-3847 (partial), XRENDERING-823 (partial), XWIKI-25503 (partial), XWIKI-25509 (partial) | |
| C1:$content | C1 clarity, $content | XWIKI-25483 | |
| C4:$content | C4 input-assistance, $content | XWIKI-25443 | |
| C1:height | C1 clarity, height | XWIKI-25483 | |
| C4:height | C4 input-assistance, height | XWIKI-25182 | |
| C13:height | C13 constraints, height | XWIKI-25182 | |
| C1:params | C1 clarity, params | XWIKI-25483 | |
| C3:params | C3 defaults, params | XWIKI-25484 | |
| C13:params | C13 constraints, params | XWIKI-25509 | |
| C1:source | C1 clarity, source | XWIKI-25483 | |
| C3:source | C3 defaults, source | XWIKI-23759 (partial) | XWIKI-25503 (partial) |
| C4:source | C4 input-assistance, source | XWIKI-25503 | |
| C2:type | C2 mandatory, type | XWIKI-16040 | |
| C4:type | C4 input-assistance, type | XWIKI-25503 | |
| C1:width | C1 clarity, width | XWIKI-25483 | |
| C4:width | C4 input-assistance, width | XWIKI-25182 | |
| C13:width | C13 constraints, width | XWIKI-25182 |
Tickets
| Ticket | Origin | KOs covered | KOs partly covered |
|---|---|---|---|
| XWIKI-16040 | Existing | C2:type | |
| XWIKI-23759 | Existing | C3:source | |
| XWIKI-25182 | Existing | C13:height C13:width C4:height C4:width | |
| XCOMMONS-3847 | New | E2 | |
| XRENDERING-823 | New | E2 | |
| XWIKI-25444 | New | D4 | |
| XWIKI-25483 | New | C1:$content C1:height C1:params C1:source C1:width | |
| XWIKI-25484 | New | C3:params | |
| XWIKI-25503 | New | C4:type C4:source | E2 C3:source |
| XINFRA-525 | New | L2 | |
| XWIKI-25443 | New | C4:$content | |
| XWIKI-25509 | New | C13:params | E2 |
Known issues of this macro
| Issue | Title | Status | Criteria |
|---|---|---|---|
| XWIKI-16040 | The Chart macro doesn't have good default values for its parameters | Open | C2 |
68 more known issues affect every macro: see the Known issues.
Lucas Charpentier