Renders a Chart.js doughnut chart that fetches label/value pairs via RPC and updates without a page reload.
DOUGHNUT — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
Parameters are not used directly; data is always fetched via the getdata RPC method using the report code. Returns an HTML string containing a styled card panel, a <canvas> element, and a <script> block that initialises and polls the chart.
Options read from self._Options JSON:
| Key | Effect |
|---|---|
width |
CSS width of the chart panel (default: 100%) |
background_colors |
JavaScript array expression of segment colours; defaults to the package palette (Blue, Indigo, Purple, Pink, Red) |
refresh |
Fallback poll interval in milliseconds if client_refresh is not set on the report definition |
Example:
{
"background_colors": ["$package_pallete_Red$", "$package_pallete_Purple$", "$package_pallete_Pink$"],
"width": "300px"
}
chart.umd.min.js) and axion.rpc.js.RpcGetdata method executes self._Query, transposes the result into [labels[], values[]], and returns that pair to the browser.chart.update() only when the data signature has changed.self.patch_param() so palette variables such as $package_pallete_Blue$ are supported.