diff options
author | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-23 01:28:46 +0200 |
---|---|---|
committer | Danijel Anđelković <adanijel99@gmail.com> | 2022-04-23 01:28:46 +0200 |
commit | 1177f4b29b616a59af39f4aef11b116f9660357d (patch) | |
tree | 36aaa26c5b78a2a5de9d86c6cde299b25f348091 /frontend/src/app/_elements/_charts/scatterchart/scatterchart.component.ts | |
parent | c8165d451b295ec610702b36fc05b8cc6047497b (diff) |
Reorganizovao stranice i komponente.
Diffstat (limited to 'frontend/src/app/_elements/_charts/scatterchart/scatterchart.component.ts')
-rw-r--r-- | frontend/src/app/_elements/_charts/scatterchart/scatterchart.component.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/frontend/src/app/_elements/_charts/scatterchart/scatterchart.component.ts b/frontend/src/app/_elements/_charts/scatterchart/scatterchart.component.ts new file mode 100644 index 00000000..9dfef4c3 --- /dev/null +++ b/frontend/src/app/_elements/_charts/scatterchart/scatterchart.component.ts @@ -0,0 +1,39 @@ +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}, + {x: 11, y: 9}, + {x: 12, y: 8}, + {x: 13, y: 6}, + {x: 14, y: 0}, + {x: 15, y: 5}, + {x: 16, y: 3}, + {x: 17, y: 2}], + backgroundColor: 'rgb(255, 99, 132)' + }] + }, + options: { + scales: { + y: { + beginAtZero: true + } + } + } + }); + } +} |