Diagrams
A new chart is created via the "Chart" selection in the component selection.
The component title, an optional chart model and the actual chart configuration are available as configuration options.
Chart model
The chart model can be used to link the chart to another selection component of the application. For example, if the chart model is linked to the selection of a table, then the chart can display an evaluation for the selected element of the table. In this case, a function must be specified as " chart configuration", which calculates the chart configuration from the selected table row.
Chart configuration
The "chart configuration" is a TL script expression which creates a configuration object for chart.js. The result of the expression must be a dictionary containing the keys type
, data
and optionally options
. Options available for type
include bar
for a bar chart, line
for a line chart. Other chart types include radar
, pie
, doughnut
, polarArea
, bubble
, and scatter
. Details for each chart configuration can be found in the chart.js documentation.
Unlike the examples given in the chart.js documentation, the key values of the chart configuration in TopLogic must always be written as strings with quotes. As values, either literal values, or TL script expressions can be used, which calculate the value based on the chart model.