Add new statistics view

This commit is contained in:
Pieter Vander Vennet 2022-08-22 13:34:47 +02:00
parent 6f6a5d7092
commit 716fda39aa
10 changed files with 342 additions and 171 deletions

View file

@ -17,6 +17,17 @@ export default class ChartJs<
protected InnerConstructElement(): HTMLElement {
const canvas = document.createElement("canvas");
// A bit exceptional: we apply the styles before giving them to 'chartJS'
if(this.style !== undefined){
canvas.style.cssText = this.style
}
if (this.clss?.size > 0) {
try {
canvas.classList.add(...Array.from(this.clss))
} catch (e) {
console.error("Invalid class name detected in:", Array.from(this.clss).join(" "), "\nErr msg is ", e)
}
}
new Chart(canvas, this._config);
return canvas;
}