tableToChartJS
Audit
- Macro ID
- tableToChartJS
- Source
- Chart.js Integration
- Type
- Generator
- Classification reason
- The macro has no content: its output, a chart drawn in the browser, comes from the table of the page that its id parameter points to, like the xdom source of chart, and the table is not wrapped or decorated by the macro.
- Status
- Reviewed
- Criteria version
- 15.20
- XWiki version
- 18.8.0
- Audit date
- 2026-10-20
- Auditor
- Compared macros
- chart liveData
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 | "Table to ChartJS" says that a table becomes a chart, in the user's words, and the library name only tells it apart from the Chart macro of XWiki Standard, which draws an image from the same kind of table. It is not a code identifier. |
| D2 summary | KO | "Draws a chart using ChartJS and the data read from a table." is the name spelled out, "Table to ChartJS", with a verb added. It does not state the rule the user needs to insert the macro: the table must be on the same page and carry an id, set with (% id="singleDataSet" %) in the source or in the Advanced tab of the table properties of the editor, and the macro gets that id in its table parameter. Without it, nothing is drawn and nothing says why, see E2. |
| D3 category | OK | in Content, like chart and liveData, the compared macros, and like ChartJS, the other macro of the extension. |
| D4 quick-action | KO | Quick Actions finds the macro first for its ID "tableToChartJS", for its name "Table to ChartJS" and for the French name "Tableau à ChartJS", which differs from the English one. The synonym "chart" ranks it 2nd, after Chart. The synonyms "graph", "diagram", "bar chart", "pie chart" and "plot" do not find it: "graph" lists Paragraph, Chart and map, "diagram" the Diagram macros and kroki, "pie chart" only jiraPieChart, and the other two nothing. The rule for a technical macro named after its technology does not apply, since the macro is for every user, in Content, and these are the words a user would type for a chart. Same result as chart, which is KO for the same reason. |
| L1 consistency | OK | compared with chart and liveData, two generators of the Content category that display data. Like chart, type is mandatory, and so is table, so Quick Actions opens the Edit Macro dialog instead of inserting the macro right away, which liveData does not need. The difference is not by design for type, since a default type would work, so it is counted under C2 of type. Unlike chart, the macro has no content, which is by design: the data is a table of the page, picked by its id, like the xdom source of chart. The defaults are not declared, except the unchecked multipleDataSets, as for liveData. |
| L2 doc-parameters | KO | the parameters are only documented on the legacy extensions.xwiki.org page of the extension, Chart.js Integration, not in the new documentation. The ten parameters of the macro are all there, with the same mandatory flags and default, but the type list "line, bar, radar, pie, doughnut, polarArea, bubble, scatter" misses horizontalBar, which the last example of the page uses. The page documents width and height with no unit, while its own source uses height="200px" in a test, and says that cssClass can set the canvas dimensions at the CSS level, which is the only way to set them with the default options, see C8. The options that make the macro useful, like backgroundColors or skipZeros, are documented for the chartjs macro only, and this page points to it. |
| L3 doc-example | OK | the most common example is "Single Data Set", {{tableToChartJS type="polarArea" table="singleDataSet" /}} with a 3 row table with the id singleDataSet. Example 1 of the Usage block, with "..." values, is a template, not an example. The five examples render a chart in view mode, after the JavaScript runs, with no error in the page or the console. The id of the table can be set in the editor, in the Advanced tab of the table properties, so the examples can be reproduced there. |
| I1 pattern | OK | Quick Actions and the Insert Macro dialog both open the Edit Macro dialog, since type and table are mandatory, the behavior of a generator that needs a value to work, like include, and the one of chart. One entry lists the macro. |
| I2 zero-config | OK | submitting the Edit Macro dialog with the default values keeps it open with no message, since type and table are required: the generic behavior of the dialog. {{tableToChartJS/}} renders "Failed to execute the [tableToChartJS] macro. Cause: [Parameter [type] is mandatory]", a configuration a generator may require. With a type and a table, the chart renders in view mode. |
| I3 instant | N/A | |
| I4 cursor | N/A | |
| I5 focus | OK | type and table, the only mandatory parameters, come first, outside the Optional parameters tab, and the focus is on table, so every mandatory parameter is visible without scrolling. |
| E1 wysiwyg | KO | the editor shows the table, and in place of the macro an empty area: the canvas of the chart stays blank, with no chart, no placeholder and no text, 2, 10 and 30 seconds after the insertion and after saving and reopening the page, where view mode draws the polar area chart with its legend after the JavaScript runs. Nothing in the editor says that a chart is there or what it shows. The hidden macro placeholder of the editor stays hidden. Same as the chartjs macro of the extension. To reproduce: insert the most common example and wait. |
| E2 errors | KO | most invalid values are accepted with no message in view mode, in the page or in the console, so the user gets a wrong or missing chart. type="unknownChart" and type="polararea" , the wrong case, draw nothing, and leave a blank area under the table. table="noSuchTable" draws an empty polar grid, with a TypeError in the console only, and table="" is accepted as well. multipleDataSets="maybe" is read as false. dataSetLabel="abc" is ignored and dataSetLabel="9" draws empty bars with a nameless legend, since the column does not exist. options="{not json" is ignored and the default options apply. width="abc" and height="-3" are accepted, and width and height have no visible effect with the default options anyway, see C8. id="my chart" is written as given, an invalid HTML id, cssClass="a b" adds two classes, which is valid. A missing type or table gives a clear error, "Parameter [type] is mandatory", which names the parameter. An unknown parameter, noSuchParameter="x" , is generic and not counted. |
| E3 nesting | KO | in a list item and in a table cell, like * {{tableToChartJS type="polarArea" table="singleDataSet" /}} , the macro renders "The [tableToChartJS] macro is a standalone macro and it cannot be used inline. Click on this message for details." in the editor and in view mode, a standalone error. In a box it renders, and the chart is drawn in view mode, like at the top level. The macro has no content, so the second half of the measure does not apply. Same as the chartjs macro. |
| E4 inline-support | OK | the macro declares no inline support, and its output is a responsive block container that Chart.js sizes to the width of its parent, which is a technical reason to stay standalone. In a sentence it renders the same standalone error as in E3, with the table in the sentence. |
| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| type | KO | KO | N/A | KO | OK | OK | N/A | OK | OK | N/A | C1, minor: "The type of chart. Choose from: line, bar, radar, pie, doughnut, polarArea, bubble, scatter." says what it sets and gives the values, but the list is presented as complete while the horizontalBar of the last example of the documentation works and is not in it, and the values are the Chart.js identifiers, written as is, with the case that matters, see E2. 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: {{tableToChartJS table="singleDataSet" /}} would give a chart instead of the error "Parameter [type] is mandatory". Because of it, Quick Actions opens the Edit Macro dialog, see L1. C4: a free text field, although the accepted values are a short list of chart types: a select, ideally with a preview of each type, could be used. type="unknownChart" and type="polararea" are accepted and draw nothing, see E2. C5: outside any group, with table, so 2 fields, and the Optional parameters group comes after. C6: second of the dialog, after table, and set by the most common example, which sets only table and type. C13: the accepted values are a list rather than a format, so it is recorded N/A: the select of C4 would declare them. |
| multipleDataSets | KO | OK | OK | OK | KO | OK | N/A | OK | OK | N/A | C1, minor: "Whether the specified table includes multiple data sets." uses a Chart.js term and does not say what the table must look like: the first column holds the labels and each other column is one data set, with the header cell as its name. Four of the five examples need it, since they have two data columns. C3: the box is unchecked, the declared default false, the value of the most common example. C4: a checkbox for a boolean. C5, minor: the 8 fields of the Optional parameters group are above 7, mixing the options of the data, multipleDataSets and dataSetLabel, with the display options, width, height, cssClass, title and id. The same holds for every parameter of the group. C6: fifth of the Optional parameters group, in alphabetical order, below cssClass, dataSetLabel, height and id, but visible without scrolling, and not set by the most common example. C8: set by four of the five examples of the documentation, so not rarely used. |
| table | KO | OK | N/A | KO | OK | OK | N/A | OK | OK | N/A | C1: "Identifies the source table." does not say what to type: the id of a table of the same page, which has to be set on the table first, see D2. It gives no possible value for a free field. To reproduce: open the Edit Macro dialog from Quick Actions. C2: mandatory, since the macro cannot guess which table of the page to draw. C4: a free text field for a reference to an element of the page, where a picker listing the tables of the page that have an id could be used. A misspelled id gives an empty chart with no message, see E2. C5: outside any group, with type, so 2 fields. C6: first of the dialog, with the focus, and set by the most common example. |
| dataSetLabel | KO | OK | OK | KO | KO | OK | N/A | KO | OK | KO | C1: "The index of the table column that represents the data set label." does not say that it only has an effect together with multipleDataSets, nor where the index starts: the last example sets "1" for a table whose second column, Project, holds the label, so it starts at 0. It uses developer terms, index and data set. C3: the field opens empty, which stands for no label column, the value of the most common example. C4: a plain text field for a column number, which a number field, or a select of the columns of the table, would fit. C5, minor: the 8 fields of the Optional parameters group are above 7, see the note of multipleDataSets. C6: third of the group, not set by the most common example. C8, minor: set by one of the five examples, and only useful for a table with a label column among its data columns. C13: a column number with no declared range, and the macro is a wiki macro, whose parameters cannot declare a range or a format, see XWIKI-25197 in the Cross-macro findings. dataSetLabel="abc" is ignored, and dataSetLabel="9" draws empty bars with a nameless legend, see E2. |
| options | OK | OK | OK | OK | KO | OK | N/A | KO | OK | KO | C1: "Advanced chart options specified as JSON. Checkout the Chart.js documentation for the available configuration options." gives the format and where the keys are listed. The keys that the macro adds, like backgroundColors, are not named, they are on the documentation page of the chartjs macro. C3: the field opens empty, for the default options of Chart.js, the value of the most common example. C4: a one line text field for a JSON object. A custom picker for this mini-syntax would be overkill, so the text field is OK, as long as the description explains the format, which it does. C5, minor: the 8 fields of the Optional parameters group are above 7, see the note of multipleDataSets. C6: sixth of the group, not set by the most common example. C8: the description itself says "Advanced", and the field is not marked advanced, while only the last example of five sets it. C13: a JSON format that the macro cannot declare, since the parameters of a wiki macro cannot declare a format, see XWIKI-25197 in the Cross-macro findings. options="{not json" is accepted and ignored, see E2. |
| width | KO | OK | OK | KO | KO | OK | N/A | KO | OK | KO | C1: "Width of the generated chart." gives no unit and does not say that it has no visible effect with the default options. The name is the ID, "width", and the description is not translated in French and German. To reproduce: open the Edit Macro dialog from Quick Actions. C3: the field opens empty, which stands for the width of the parent, the value of the most common example. C4: a plain text field for a number of pixels, the value of the width attribute of the canvas. C5, minor: the 8 fields of the Optional parameters group are above 7, see the note of multipleDataSets. The field is the last of the dialog, below the fold. C6: last of the group, not set by the most common example. C8: not marked advanced, and with the default options it changes nothing: width="300" is written on the canvas, which Chart.js resizes to the width of its container, 803 pixels in the audit. It only applies with options='{"responsive": false}' . C13: a number of pixels with no declared range, and the parameters of a wiki macro cannot declare one, see XWIKI-25197 in the Cross-macro findings. width="abc" is accepted, see E2. |
| height | KO | OK | OK | KO | KO | OK | N/A | KO | OK | KO | C1: "Height of the generated chart." gives no unit and does not say that it has no visible effect with the default options. The name is the ID, "height", and the description is not translated in French and German. The test page of the extension itself sets height="200px" , which is not a number of pixels. C3: the field opens empty, which stands for the height that Chart.js computes from the width, the value of the most common example. C4: a plain text field for a number of pixels, the value of the height attribute of the canvas. C5, minor: the 8 fields of the Optional parameters group are above 7, see the note of multipleDataSets. C6: third of the group, not set by the most common example. C8: not marked advanced, and with the default options it changes nothing: height="150" is overridden by the aspect ratio of Chart.js. It only applies with options='{"maintainAspectRatio": false}' , where the height is then 150 pixels, or with responsive set to false in the options. C13: a number of pixels with no declared range, and the parameters of a wiki macro cannot declare one, see XWIKI-25197 in the Cross-macro findings. height="-3" is accepted, see E2. |
| cssClass | OK | OK | OK | OK | KO | OK | N/A | KO | OK | N/A | C1: "Additional CSS class to be added to the chart container." is a technical term for a styling hook, which another wording would only make more confusing. The name is the ID and the description is not translated in French and German. C4: a text field for CSS classes, which is the usual input for a styling hook. C5, minor: the 8 fields of the Optional parameters group are above 7, see the note of multipleDataSets. C6: first of the group, not set by the most common example. C8: a rarely used styling hook, not marked advanced. |
| title | KO | OK | OK | OK | KO | OK | N/A | OK | OK | N/A | C1: "Chart title, added as aria-label to the generated canvas" uses developer terms, and the name suggests a title drawn on the chart, like the title of the Chart macro of XWiki Standard, while it is only the text alternative of the canvas, which no title is drawn from. The meaning is clear once read, so the KO is minor. The name is the ID and the description is not translated in French and German. C3: the field opens empty, for no text alternative, the value of the most common example. A chart with no title has an img role and no name. C5, minor: the 8 fields of the Optional parameters group are above 7, see the note of multipleDataSets. The field is below the fold. C6: seventh of the group, not set by the most common example. C8: the only text alternative of a chart that screen readers cannot read, so it is not a rarely used parameter, even if the examples do not set it. |
| id | OK | OK | OK | OK | KO | OK | N/A | KO | OK | KO | C1: "Chart identifier" is a technical term for a hook, the id of the canvas, which another wording would only make more confusing. The name is the ID and the description is not translated in French and German. C5, minor: the 8 fields of the Optional parameters group are above 7, see the note of multipleDataSets. C6: fourth of the group, not set by the most common example. C8: a rarely used hook, not marked advanced. C13: an HTML id has no space and is unique in the page, a format that the macro cannot declare, since the parameters of a wiki macro cannot declare one, see XWIKI-25197 in the Cross-macro findings. id="my chart" is accepted and written on the canvas as given, an invalid id, see E2. |
Other notes
Bug outside the criteria: the title parameter is only the aria-label of the canvas and no title is drawn on the chart, unlike the title of the Chart macro of XWiki Standard, see the C1 note of title.
The English names of the parameters width, height, cssClass, title and id are their IDs, and their descriptions are not translated in French and German, which translate the other parameters and the name of the macro. The Insert Macro dialog capitalizes them, so only the lowercase ones in the descriptions read as IDs.
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 |
|---|---|---|---|
| D2 | D2 summary | CHARTJS-40 | |
| D4 | D4 quick-action | XWIKI-25444 | |
| L2 | L2 doc-parameters | XINFRA-525 | |
| E1 | E1 wysiwyg | XWIKI-22046 (partial) | XWIKI-25523 (partial), CHARTJS-43 |
| E2 | E2 errors | XWIKI-25197 (partial) | XCOMMONS-3847 (partial), XRENDERING-823 (partial), CHARTJS-42 (partial) |
| E3 | E3 nesting | XWIKI-23501 | |
| C1:type | C1 clarity, type | CHARTJS-40 | |
| C2:type | C2 mandatory, type | CHARTJS-41 | |
| C4:type | C4 input-assistance, type | XWIKI-23045 (partial) | CHARTJS-42 |
| C1:multipleDataSets | C1 clarity, multipleDataSets | CHARTJS-40 | |
| C5:multipleDataSets | C5 groups, multipleDataSets | CHARTJS-41 | |
| C1:table | C1 clarity, table | CHARTJS-40 | |
| C4:table | C4 input-assistance, table | XWIKI-23045 (partial) | CHARTJS-42 |
| C1:dataSetLabel | C1 clarity, dataSetLabel | CHARTJS-40 | |
| C4:dataSetLabel | C4 input-assistance, dataSetLabel | XWIKI-23045 (partial) | CHARTJS-42 |
| C5:dataSetLabel | C5 groups, dataSetLabel | CHARTJS-41 | |
| C8:dataSetLabel | C8 advanced, dataSetLabel | CHARTJS-41 | |
| C13:dataSetLabel | C13 constraints, dataSetLabel | XWIKI-25197 | |
| C5:options | C5 groups, options | CHARTJS-41 | |
| C8:options | C8 advanced, options | CHARTJS-41 | |
| C13:options | C13 constraints, options | XWIKI-25197 | |
| C1:width | C1 clarity, width | XWIKI-6061 (partial) | CHARTJS-40 |
| C4:width | C4 input-assistance, width | XWIKI-25197 (partial), XWIKI-25182 (partial) | CHARTJS-42 |
| C5:width | C5 groups, width | CHARTJS-41 | |
| C8:width | C8 advanced, width | CHARTJS-41 | |
| C13:width | C13 constraints, width | XWIKI-25197 | |
| C1:height | C1 clarity, height | XWIKI-6061 (partial) | CHARTJS-40 |
| C4:height | C4 input-assistance, height | XWIKI-25197 (partial), XWIKI-25182 (partial) | CHARTJS-42 |
| C5:height | C5 groups, height | CHARTJS-41 | |
| C8:height | C8 advanced, height | CHARTJS-41 | |
| C13:height | C13 constraints, height | XWIKI-25197 | |
| C5:cssClass | C5 groups, cssClass | CHARTJS-41 | |
| C8:cssClass | C8 advanced, cssClass | CHARTJS-41 | |
| C1:title | C1 clarity, title | XWIKI-6061 (partial) | CHARTJS-40 |
| C5:title | C5 groups, title | CHARTJS-41 | |
| C5:id | C5 groups, id | CHARTJS-41 | |
| C8:id | C8 advanced, id | CHARTJS-41 | |
| C13:id | C13 constraints, id | XWIKI-25197 |
Tickets
| Ticket | Origin | KOs covered | KOs partly covered |
|---|---|---|---|
| XWIKI-22046 | Existing | E1 | |
| XWIKI-23501 | Existing | E3 | |
| XWIKI-25197 | Existing | C13:dataSetLabel C13:height C13:id C13:options C13:width | C4:width C4:height E2 |
| XWIKI-6061 | Existing | C1:height C1:title C1:width | |
| XCOMMONS-3847 | New | E2 | |
| XRENDERING-823 | New | E2 | |
| XWIKI-25444 | New | D4 | |
| CHARTJS-40 | New | C1:dataSetLabel C1:multipleDataSets C1:table C1:type D2 C1:width C1:height C1:title | |
| CHARTJS-41 | New | C2:type C5:cssClass C5:dataSetLabel C5:height C5:id C5:multipleDataSets C5:options C5:title C5:width C8:cssClass C8:dataSetLabel C8:height C8:id C8:options C8:width | |
| CHARTJS-42 | New | C4:type C4:table C4:dataSetLabel C4:width C4:height | E2 |
| XWIKI-23045 | Existing | C4:type C4:table C4:dataSetLabel | |
| XWIKI-25182 | Existing | C4:width C4:height | |
| XINFRA-525 | New | L2 | |
| XWIKI-25523 | New | E1 | |
| CHARTJS-43 | New | E1 |
Known issues of this macro
No known issue is specific to this macro.
68 more known issues affect every macro: see the Known issues.
Lucas Charpentier