Working JavaScript charts
[gpl/argeo-suite.git] / js / src / chart / BarChart.js
diff --git a/js/src/chart/BarChart.js b/js/src/chart/BarChart.js
new file mode 100644 (file)
index 0000000..d65b9cc
--- /dev/null
@@ -0,0 +1,27 @@
+import Chart from 'chart.js/auto';
+
+import ChartJsPart from './ChartJsPart.js';
+
+export default class BarChart extends ChartJsPart {
+       /** Constructor taking the mapName as an argument. */
+       constructor(chartName) {
+               super(chartName);
+               this.setChart(new Chart(this.getChartCanvas(), {
+                       type: 'bar',
+                       data: {
+                               datasets: []
+                       },
+                       options: {
+                               scales: {
+                                       y: {
+                                               beginAtZero: true
+                                       },
+                               },
+                               animation: false,
+                       }
+               }));
+
+       }
+
+
+}