diff options
author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-04-20 00:12:42 +0000 |
---|---|---|
committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-04-20 00:12:42 +0000 |
commit | b814ef17d31dca80a3f23b3fbe4ce56885192a4c (patch) | |
tree | d7a297db46d57267b5516a8c20ee906dd39571ed /frontend/src/app/mixed-chart/mixed-chart.component.ts | |
parent | 9a480b28ac9b93dee082925b9cb4beef3244b135 (diff) | |
parent | e6d9e3fd2dcf83c90db8560e749544dfd9910d07 (diff) |
Merge branch 'dev' into 'master'
Merge master
See merge request igrannonica/neuronstellar!27
Diffstat (limited to 'frontend/src/app/mixed-chart/mixed-chart.component.ts')
-rw-r--r-- | frontend/src/app/mixed-chart/mixed-chart.component.ts | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/frontend/src/app/mixed-chart/mixed-chart.component.ts b/frontend/src/app/mixed-chart/mixed-chart.component.ts new file mode 100644 index 00000000..2524ee36 --- /dev/null +++ b/frontend/src/app/mixed-chart/mixed-chart.component.ts @@ -0,0 +1,56 @@ +import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import {Chart} from 'node_modules/chart.js'; + +@Component({ + selector: 'app-mixed-chart', + templateUrl: './mixed-chart.component.html', + styleUrls: ['./mixed-chart.component.css'] +}) +export class MixedChartComponent implements AfterViewInit { + + @ViewChild('mixedchart') chartRef!: ElementRef; + constructor() { } + + ngAfterViewInit(): void { + const myChart = new Chart(this.chartRef.nativeElement, { + type: 'bar', + data: { + labels: ["1900", "1950", "1999", "2050"], + datasets: [{ + label: "Europe", + type: "line", + borderColor: "#8e5ea2", + data: [408,547,675,734], + fill: false + }, { + label: "Africa", + type: "line", + borderColor: "#3e95cd", + data: [133,221,783,2478], + fill: false + }, { + label: "Europe", + type: "bar", + backgroundColor: "rgba(0,0,0,0.2)", + data: [408,547,675,734], + }, { + label: "Africa", + type: "bar", + backgroundColor: "rgba(0,0,0,0.2)", + //backgroundColorHover: "#3e95cd", + data: [133,221,783,2478] + } + ] + }, + /*options: { + title: { + display: true, + text: 'Population growth (millions): Europe & Africa' + }, + legend: { display: false } + }*/ + + }); + } + +} |