Renders a Chart.js line chart optimised for large datasets, with automatic multi-series detection and live RPC polling.
LINE — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
Param1 and Param2 are forwarded in RPC poll requests as param1 and param2 for SQL token substitution. Data is read from self.data_list on first render; subsequent updates arrive via the RPC polling loop. Returns an HTML string containing a styled card panel, a <canvas> element, and the Chart.js initialisation and poll scripts. Returns an empty string if self.data_list is empty.
getChartType()Returns "line". Overridden by ObjReportBar ("bar") and ObjReportBubble ("bubble").
AddRPC(html, Guid)Prepends a <script> block that sets up the setInterval polling loop. On each tick, RemoteProcedureCall fetches fresh data via method=getdata; if the response has changed and the GUID matches, myLineChart{Guid}.data is updated in place and chart.update('none') is called to suppress animation.
RpcGetdata(data)Server-side RPC handler. Fetches the SQL query from def_report by report code, substitutes $param1$, runs the query, and returns [rows, headings, guid]. Supports nested SQL: if the first cell of the result is itself a valid SQL statement, it is executed as a secondary query.
Options read from self._Options JSON:
| Key | Effect |
|---|---|
width |
CSS width of the chart panel (default: 100%) |
title_x |
Label for the X axis; can also be supplied as a title_x column in the SQL result |
title_y |
Label for the Y axis; can also be supplied as a title_y column in the SQL result |
graph_colour |
Overrides per-series colours with a single colour for all series |
maintainAspectRatio |
Passed to Chart.js (default: true); set to false to prevent flickering in some layouts |
Example:
{"width": "600px", "title_x": "metres", "title_y": "height"}
chart.umd.min.js) and axion.rpc.js.{X-value}, {Y-value-1}, {Y-value-2}, ..., {colour-1}, {colour-2}, ...self.data_list[0] when graph_colour is not set. If fewer colours than series are provided, the last colour is reused._Maxval and _Minval on the report definition control Y-axis clamping when non-zero.Decimal and datetime values are serialised to float and ISO 8601 strings.data_list is a SQL statement, it is resolved via self.patch_param() and re-executed.client_refresh (seconds) or _Refresh on the report definition.