aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/scatterchart/scatterchart.component.ts
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-03-20 21:11:18 +0100
committerNevena Bojovic <nenabojov@gmail.com>2022-03-20 21:11:18 +0100
commit34254357ea1a6c15b386162b63eb451e91895c9d (patch)
tree24ef2b6d529cf81d0be0e2efd56e9e4c474f4806 /frontend/src/app/scatterchart/scatterchart.component.ts
parent1f4d193f475c627cd06989188ca98ba12da368a5 (diff)
Doradjeni grafici.
Diffstat (limited to 'frontend/src/app/scatterchart/scatterchart.component.ts')
-rw-r--r--frontend/src/app/scatterchart/scatterchart.component.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/frontend/src/app/scatterchart/scatterchart.component.ts b/frontend/src/app/scatterchart/scatterchart.component.ts
new file mode 100644
index 00000000..1da88fe7
--- /dev/null
+++ b/frontend/src/app/scatterchart/scatterchart.component.ts
@@ -0,0 +1,32 @@
+import { Component, OnInit } from '@angular/core';
+import {Chart} from 'node_modules/chart.js';
+
+@Component({
+ selector: 'app-scatterchart',
+ templateUrl: './scatterchart.component.html',
+ styleUrls: ['./scatterchart.component.css']
+})
+export class ScatterchartComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(){
+ const myChart = new Chart("ScatterCharts", {
+ type: 'scatter',
+ data: {
+ datasets: [{
+ label: 'Scatter Example:',
+ data: [{x: 1, y: 11}, {x:2, y:12}, {x: 1, y: 2}, {x: 2, y: 4}, {x: 3, y: 8},{x: 4, y: 16}, {x: 1, y: 3}, {x: 3, y: 4}, {x: 4, y: 6}, {x: 6, y: 9}],
+ backgroundColor: 'rgb(255, 99, 132)'
+ }]
+ },
+ options: {
+ scales: {
+ y: {
+ beginAtZero: true
+ }
+ }
+ }
+ });
+ }
+}