]>
git.argeo.org Git - gpl/argeo-suite.git/blob - js/src/chart/ChartPart.js
1 /** API to be used by Java.
5 /** Abstract base class for displaying a map. */
6 export default class ChartPart
{
8 /** The name of the chart, will also be the name of the variable */
11 constructor(chartName
) {
12 this.#chartName
= chartName
;
13 this.createChartCanvas(this.#chartName
);
20 /** Create the div element where the chart will be displayed. */
21 createChartCanvas(id
) {
22 const chartDiv
= document
.createElement('canvas');
24 //chartDiv.style.cssText = 'width: 100%;';
25 chartDiv
.style
.cssText
= 'width: 100%; height: 100vh;';
26 document
.body
.appendChild(chartDiv
);
29 /** Get the div element where the chart is displayed. */
31 return document
.getElementById(this.#chartName
);