]> git.argeo.org Git - gpl/argeo-suite.git/blob - js/src/chart/ChartPart.js
Revert loading of XSD
[gpl/argeo-suite.git] / js / src / chart / ChartPart.js
1 /** API to be used by Java.
2 * @module MapPart
3 */
4
5 /** Abstract base class for displaying a map. */
6 export default class ChartPart {
7
8 /** The name of the chart, will also be the name of the variable */
9 #chartName;
10
11 constructor(chartName) {
12 this.#chartName = chartName;
13 this.createChartCanvas(this.#chartName);
14 }
15
16
17 //
18 // HTML
19 //
20 /** Create the div element where the chart will be displayed. */
21 createChartCanvas(id) {
22 const chartDiv = document.createElement('canvas');
23 chartDiv.id = id;
24 //chartDiv.style.cssText = 'width: 100%;';
25 chartDiv.style.cssText = 'width: 100%; height: 100vh;';
26 document.body.appendChild(chartDiv);
27 }
28
29 /** Get the div element where the chart is displayed. */
30 getChartCanvas() {
31 return document.getElementById(this.#chartName);
32 }
33
34 }