Generic Table
The generic table setting are inherited by table, property, and console widgets.
[widget] Settings
Name | Example | Description | Chart Lab |
---|---|---|---|
responsive | responsive = true | Adjust font size based on widget dimensions. Font size is reduced when the widget size is smaller. Default: false. | View |
replace-underscore | replace-underscore = true | Replace underscores with spaces in column names. Default: false. | View |
capitalize | capitalize = false | Capitalize column names. Default: true. | View |
display-tags | display-tags = mount_point display-tags = file_system display-tags = app display-tags = alias | Display a separate column for each tag in the underlying series. Default: false. | View View |
show-tag-names | show-tag-names = true | Display all tags for the entity. Only works if the table contains the tag column. Default: false. | View |
sort | sort = cpu_busy desc sort = memfree asc | Sorting the table by columns or properties. It is necessary to set in sequence the keys of the columns or names of the properties. Specify desc after the key or property name if you want to sort in reverse order( asc is used by default).
i.e. | View |
column-{key} | column-entity = Entity column-time = Timestamp column-entity = null column-time = null column-metric = null column-value = null | Shortcut to change column name (column-{key}=new-name) or hide it (column-{key}=null). | View |
columns | columns = command | Column keys; used to add new or rename existing columns. | View |
class | class = terminal | Changes the widget to UNIX console style with the background set to black. Possible settings: terminal. | View |
transpose | transpose = true | Transpose rows and columns for a layout optimized for columnar presentation. Possible values: true, false. Default: false. | View |
format | format = %H:%M:%S format = %d/%m %H:%M:%S | Format time values. For example when using the min_time_value or max_time_value aggregators. Learn more about format settings. | View |
merge-columns | merge-columns = entity merge-columns = entity, tags | Column key by which columns are grouped into rows. | View |
auto-height | auto-height = true | Calculate row height automatically based on amount of vertical space allocated to the widget and the number of rows. Default: false | View |
font-scale | font-scale = 0.7 | Ratio of font height to row height when auto-height is enabled. Minimum row height is 10px, maximum row height is 64px. Default: 0.5 | View |
table-header-style | table-header-style = display: none | Custom CSS style applied to table header, including a style to hide the header altogether. | View |
header-style | header-style = display: none | Custom CSS style applied to widget header, including a style to hide the widget header altogether. | View |
[column] Settings
Name | Example | Description | Chart Lab |
---|---|---|---|
key | key = pid key = %cpu key = size | Name of the key. Optional setting, but if set, then in the configuration of this column you can set sorting. If you indicate the name of the key as the property received from the server object, then the value of the cell by default will be the value of this property. | View |
tag | tag = file_system tag = mount_point | Name of tag, which needs to be displayed in a separate column. Optional settings. Only has purpose if the object received from the server contains the property tags. Value of the cell by default will be equal to the value of this tag. | View |
value | value = row.openTime | JavaScript code to determine the value of the cell (by default the value of the key or tag is used). | View |
format | format = kilobytes format = #### | Format of the cell’s value. | View |
label | label = Virtual label = Resident label = PID | Name of column displayed in the column titles. Can be specified as JavaScript code. | View |
tooltip | tooltip = Process CPU Usage tooltip = Process ID | Description of the column, displayed during mouseover on the title. | View |
style | style = text-align: left style = text-align: center style = background: orange | Style assigned to the column. Can be specified as JavaScript code. | View |
row-style | row-style = value > 1 ? 'background: orange' : null | Style assigned to the entire row. Can be specified as JavaScript code. | View |
style = max-width: | style = max-width: 50% style = max-width: 400px | Prevent scrolling in columns containing long text strings. Scroll bar will only appear when the column shrinks below the specified width. Can be set in percent or in pixels. If transpose = true , then set style = max-width: in pixels. | View |
alert-expression | alert-expression = value > 5 alert-expression = value < 200000 | JavaScript code. The returned value of the evaluation can be used for sorting, if for the column a key is specified (in sort alert-{key} is placed in this case). | View |
alert-style | alert-style = background-color: yellow alert-style = background-color: orange | Styles assigned to the cell. If the result of evaluation alert-expression is greater than or less than 0. Can be specified as JavaScript code. | View |
row-alert-style | row-alert-style = background-color: orange | Styles assigned to the whole row. If the result of the evaluation alert-expression is greater than or less than 0. Can be specified as JavaScript code. | View |
display | display = false | Hide a column. Default value is 'true' (show column). | View |
on-click | onclick = var s = series({ metric: 'nmon.process.%cpu', disconnectInterval: '90 second' })
| JavaScript code, click event handler of the cell. Supports the method filter, which allows you to filter the rows in the table to the value of this cell. | View |
icon | icon = value > 1 ? 'exclamation-sign' : 'ok' | Name of the icon displayed in the cell. Can be specified as JavaScript code. | View |
position | position = first | Position of the column relative to other columns in the table. | View |
Column Order
Column order is determined by the order of [column]
sections in the widget configuration.
Default widget columns have a pre-defined position, for example the Severity
column in Console
widget is positioned first by default.
To change the position of the default column, specify it explicitly in the widget configuration.
View example in Chartlab.
The [column] section support the position
setting to control the placement of the column regardless of the order in which [column] section is specified in the widget. The possible values are first
, middle
and last
.
Columns are positioned with the following order:
| first | [column] | column-{key}={label} | predefined widget columns | middle | expand-tags columns | last |
View example in Chartlab.
Table Example:
[widget] type = table capitalize = false replace-underscore = true column-entity = Host column-tags = null [column] tag = file_system [column] key = time format = %d/%m %H:%M [column] key = value value = Math.round(value * 100) / 100 format = value + '%' style = value < 10 ? 'opacity: .5' : '' alert-expression = value > 99 ? 2 : value > 90 ? 1 : 0 alert-style = if (alert == 2) return 'background: red' alert-style = return 'background: black; color: white' alert-row-style = background: orange onclick = filter() columns = metric columns = entity sort = alert-value desc, entity, metric |
In this example, the table columns will be located in the following order: File System, Time, Value, Metric, Host.