On line guide/help
You are on page 36 of the online help. Navigate sequentially through the guide pages or search for a topic of interest to you.
Index Prev. NextDatalist
Data list for charts
Defines a data set to use with charts. These can be constant values defined in the template, placeholders valued via variables, or placeholders linked to a data provider (in which case the values will be loaded from the database).
The data element
The <datalist> element contains a list of <data> elements, each of which defines one or more values to be represented in the graphs.
Elements / attributes of the <data> element:
<label> (string) Text that describe the data label
<color> (string, rgb hex color) Value color, used only for some chart types (donut, single bar). Format : #RRGGBB (the prefix # is optional). Default color is 000000 (black).
<value> (numeric, float) Value to represent in the chart. For some chart types (bar/area, line), it is possible to define multiple values separated by spaces, each linked to a measure.
Example with 2 constant values defined in the template
To populate a datalist with database values, you need to set a data provider and set its ID in the datalist. Placeholders will automatically be replaced with database data.
Example of a datalist connected to a data provider
The DataProvider must be initialized on the backend as shown in the following example. The DataProvider ID must be specified in the DataList, and the placeholders must have the same name as the data fields.
Example PHP code