Chart HTML
Warning
Rework pending, no delivery date. The Front App SDK (ReactJS) and the Front API SDK (NodeJS) are both being replaced. This page documents the current release, remains accurate, and is maintained until the replacement ships. Code written against it keeps working.
The Chart HTML allows you to format a query result into an HTML fragment. This is typically used to display one value such as a KPI.
Chart HTML configuration example
In this example :
- it declares the
htmlcomponent - a
requestgets thesumofrideson the period defined by thedatepickerdynamic parameter, and get the value for the previous year optionsdescribes how the component is rendered
Default templates
The following templates are already defined and may be set as template-name.
block
evol
Custom Template
It is possible to define a custom HTML fragment using options.template.
In that fragment, everything between {} will be interpreted as Javascript with a scope variable defined.
The scope variable
The scope variable is an object with the following fields :
value: the first field of the result, formatted with defined rulesevol: whetherevolis defined in the request, the evolution in percentageevolClass: whetherevolis defined in the request, an helper for styling, eitherevol positiveorevol negativeoptions: the completechart.optionsto be used in templatesquery_params: the complete query executed by the Analytics Manager with expanded Dynamic parametersresponse: the complete response from the Analytics Manager with all results

