Renders a Chart.js grouped bar chart displaying three time-period datasets (earliest, previous, latest) for deviation analysis.
HISTOGRAM — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
Parameters are not used; data is read from self.data_list (pre-loaded by the report engine). Returns an HTML string with a styled card panel, a <canvas> element, and Chart.js initialisation and polling scripts. Returns an empty string if self.data_list is empty.
Options read from self._Options JSON:
| Key | Effect |
|---|---|
title_x |
Label for the X axis |
title_y |
Label for the Y axis |
width |
CSS width of the chart panel (default: 100%) |
labels |
Explicit list of bucket labels; defaults to the first column of the query result |
color_earliest |
Background colour for the T-2 dataset (default: "Green") |
color_previous |
Background colour for the T-1 dataset (default: "Red") |
color_latest |
Background colour for the Today dataset (default: "Blue") |
label_earliest |
Legend label for T-2 (default: "T-2") |
label_previous |
Legend label for T-1 (default: "T-1") |
label_latest |
Legend label for Today (default: "Today") |
Example:
{
"width": "100%",
"title_x": "Score Range",
"title_y": "Score Percentage",
"label_earliest": "T-2",
"label_previous": "T-1",
"label_latest": "Today",
"color_earliest": "$package_pallete_primary$",
"color_previous": "Blue",
"color_latest": "rgba(255, 99, 132, 0.5)"
}
chart.umd.min.js), axion.rpc.js, and jquery.timeago.js.AddRPC polling loop calls method=getdata at the interval defined by self._Refresh (milliseconds); on data change it updates all three datasets.self.patch_param() so palette variables are supported.