Table
Note
This feature is only available with the Business service plan.
This type of chart supports the same functionality as the table in the wizard: you can customize styles, set up cross-filtering, pagination, etc.
Structure on the Prepare tab
On the Prepare tab, in module.exports, you need to create a structure:
module.exports = {
head: ...,
rows: ...,
footer: ...,
};
The required head field configures the table header cells.
The field value is an array of JSON objects in the following format:
[{
id: "<string>",
name: "<string>",
formattedName: "<string>" | <markup configuration>,
type: "<string>",
hint: "<string>",
format: "<string>",
formatter: <object>,
align: "<string>",
min: <number>,
max: <number>,
showLabel: <boolean>,
barHeight: "<string>" | <number>,
width: "<string>" | <number>,
group: <boolean>,
pinned: <boolean>,
css: <object>,
sub: [<object>],
custom: <object>,
}]
Where:
-
id: Contains a unique ID of the table column. Required field; string value type. -
name: Outputs the value to the table header cell unlessformattedNameis explicitly specified. Optional field; string value type. -
formattedName: Outputs the value to the table header cell, overriding thenamefield value. Optional field; value type: string or a markup result set through the Editor.generateHtml(args) function. -
type: Sets the column data type. Optional field; string value type. Possible values:text: String.number: Number.date: Date (in milliseconds) with time displayed in the browser time zone.bar: Indicator.
The default value is
text. -
hint: Tooltip in the table header cell. When hovering over the question mark, the tooltip displays the field value. Optional field; string value type (with Markdown support). -
format: Sets the column data formatting. Optional field; string value type, available for adatetype field. Example of aformatvalue:format: "DD/MM/YY HH:mm:ss" -
formatter: Sets the column data formatting. Optional field; value type is object in this format:{ precision: <number>, multiplier: <number>, suffix: "<string>", prefix: "<string>", }Where:
precision: Rounding precision (number of decimal places) for all values in the column. Available fornumbertype fields.multiplier: Multiplier for all values in the column. Available fornumbertype fields.suffix: Text to output after a cell value in the entire column.prefix: Text to output before a cell value in the entire column.
-
align: Indicator alignment within a cell. Optional field; available forbartype fields. String value type, possible values arerightandleft. The default value isright.Note
If you only specify the
maxvalue, Editor will render a bar from left to right. You can change this withalign: 'right'.If you only specify the
minvalue, Editor will render a bar from right to left. You can change this withalign: 'left'.If you specify both
maxandmin, a floating zero appears, from which the bar is rendered to the right for positive values and to the left for negative ones. In this case, Editor ignores thealignvalue. -
min: Minimum threshold for an indicator. Optional field; number value type. Available forbartype fields. -
max: Maximum threshold for an indicator. Optional field; number value type. Available forbartype fields. -
showLabel: Displaying the indicator label. Optional field; number value type. Available forbartype fields. The default value istrue. -
barHeight: CSS style for the indicator height. Optional field; available forbartype fields. Number or string value type from the available height CSS style values. The default value is100%. -
width: Column cell width. Optional field. Number or string value type from the available width CSS style values. The default value isauto. -
group: Whether to group values into a single cell. Applies to consecutive identical cell values in the column. Optional field;booleanvalue type. The default value isfalse. -
pinned: Whether the column is pinned when scrolling horizontally. Optional field;booleanvalue type. The default value isfalse. -
css: Description of CSS styles for the table header cell. Optional field; value type: object from CSS properties. -
sub: Array of table header cells for setting a two-tier head. The array elements must be objects with fields identical to theheadfield ones. -
custom: Cell parameter configuration for cross-filtering. For more information, see Cross-filtering.
The rows field is a required one; it contains the configuration for table cell contents.
The field value is a JSON object in the following format:
{
cells: [{
value: "<string>" | <number> | <date>,
formattedValue: "<string>" | <markup configuration>,
type: "<string>",
align: "<string>",
min: <number>,
max: <number>,
showLabel: <boolean>,
barHeight: "<string>" | <number>,
barColor: "<string>",
width: "<string>" | <number>,
link: <object>,
onClick: <object>,
}, ...]
}
Where:
-
value: Table cell content value unlessformattedValueis set. Required field; string, number or date value type. Forbartype cells, this is the indicator value. -
formattedValue: Table cell content value which overridesvalue. Optional field; value type: string, number, date, or a markup result set through the Editor.generateHtml(args) function. Inbarcells, it is used for the indicator label. -
type: Overrides theheadvalue for a specific cell. For more information about the field, see above. -
align: Sets the indicator alignment value, if not specified inhead. For more information about the field, see above. -
min: Sets the minimum threshold value for an indicator, if not specified inhead. For more information about the field, see above. -
max: Sets the maximum threshold value for an indicator, if not specified inhead. For more information about the field, see above. -
showLabel: Sets how to display the indicator label, if not specified inhead. For more information about the field, see above. -
barHeight: Sets how to style the indicator height in CSS, if not specified inhead. For more information about the field, see above. -
css: Description of CSS styles for a table cell. Optional field; value type: object from CSS properties. -
link: Sets the display of the entire cell content as a link fortexttype columns. Optional field; value type is object in this format:{ href: "<string>", newWindow: <boolean>, }Where:
href: URL to go to.newWindow: Indicates whether to open the link in a new window.
-
onClick: Action on cell click. Optional field; value type is object in this format:{ action: "<string>", args: <object>, }Where:
action: Action type. Possible values:setParams(sets new parameter values on click).args: Static arguments for the action, e.g., forsetParams, the arguments are an object with a key and a new parameter value.
The
footerfield is an optional one; it contains the configuration for table footer cells. Its format is identical to therowsfield.
Available methods
Supports the same functionality as the table in a wizard.
Structure on the Config tab
This tab describes visualization settings. Use module.exports on the Config tab to create a structure:
module.exports = {
title: <object>,
sort: "<string>",
order: "<string>",
paginator: <object>,
size: "<string>",
events: {
click: [{
// You can also define it as an array of objects.
handler: {type: 'setActionParams'},
// Currently, only one scope, 'row', is supported.
scope: 'row',
}
]},
};
Where all fields are optional:
-
title: Object in the following format:{ text: "<string>", style: <object>, // header CSS styles style: { 'text-align': 'center', 'font-size': '20px' }Where:
text: Table header.style: Description of CSS styles for the table header. Value type: object from CSS properties.
-
order: Sorting order. String value type from these possible values:acs(ascending) ordesc(descending). -
paginator: Table pagination configuration. Value type: object in the following format:{ enabled: <boolean>, limit: <number>, }Where:
-
enabled: Indicates that pagination is enabled. Boolean value type. -
limit: Number of rows per page for pagination. Number value type.Note
If specified, the
limitfield value affects only the number of rows displayed in the pagination component and not the number of rows displayed in the table body. Implement this in code on the Prepare tab using the Editor.getCurrentPage() helper method.
-
-
size: Table size, including font size, line spacing, and indentation within cells. String value type from these possible values:l,m, ors. -
events: Specifies a configuration for cross-filtering in the table. To override this configuration for a specific cell, use thecustomfield for the cell. For more information, see Cross-filtering.