diff options
author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-04-26 23:54:04 +0200 |
---|---|---|
committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-04-26 23:54:04 +0200 |
commit | aa254b6c3075805b000d774a98421aecbcb975a8 (patch) | |
tree | 6e32a720d2bfb57726d0c72bd6428b94dd14d891 /frontend/src/app/_elements/_charts | |
parent | 247c5f6ec45c7ceb4a2dcfbe633a76928fb10a82 (diff) | |
parent | 6196023a54bcf0ac5a81c64aff0bcf55f22e0ef8 (diff) |
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into Redesign
Diffstat (limited to 'frontend/src/app/_elements/_charts')
-rw-r--r-- | frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts | 62 | ||||
-rw-r--r-- | frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts | 15 |
2 files changed, 49 insertions, 28 deletions
diff --git a/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts b/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts index 078e7176..45e83e83 100644 --- a/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts +++ b/frontend/src/app/_elements/_charts/box-plot/box-plot.component.ts @@ -16,33 +16,32 @@ Chart.register(BoxPlotController, BoxAndWiskers, LinearScale, CategoryScale); }) export class BoxPlotComponent implements AfterViewInit { - @Input()width: number = 800; - @Input()height: number = 450; + @Input()width: number = 600; + @Input()height: number = 800; @ViewChild('boxplot') chartRef!: ElementRef; constructor() { } boxplotData = { // define label tree - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [{ - label: 'Dataset 1', - backgroundColor: 'rgba(255,0,0,0.5)', - borderColor: 'red', - borderWidth: 1, - outlierColor: '#999999', - padding: 10, - itemRadius: 0, - data: [ - randomValues(100, 0, 100), - randomValues(100, 0, 20), - randomValues(100, 20, 70), - randomValues(100, 60, 100), - randomValues(40, 50, 100), - randomValues(100, 60, 120), - randomValues(100, 80, 100) - ] - }, { + labels: ['January'/*, 'February', 'March', 'April', 'May', 'June', 'July'*/], + datasets: [{ + label: 'Dataset 1', + backgroundColor: 'rgba(255,0,0,0.5)', + borderColor: 'red', + borderWidth: 1, + outlierColor: '#999999', + padding: 10, + itemRadius: 0, + data: [ + randomValues(100, 0, 100), + /*randomValues(100, 0, 20), + randomValues(100, 20, 70), + randomValues(100, 60, 100), + randomValues(40, 50, 100), + randomValues(100, 60, 120), + randomValues(100, 80, 100)*/ + ]}/*, { label: 'Dataset 2', backgroundColor: 'rgba(0,0,255,0.5)', borderColor: 'blue', @@ -59,12 +58,29 @@ export class BoxPlotComponent implements AfterViewInit { randomValues(100, 20, 100), randomValues(100, 80, 100) ] - }] + }*/] }; ngAfterViewInit(): void { const myChart = new Chart(this.chartRef.nativeElement, { type: "boxplot", - data: this.boxplotData + data: this.boxplotData, + options: { + /*title: { + display: true, + text: 'Predicted world population (millions) in 2050' + }*/ + plugins:{ + legend: { + display: false + }, + }, + scales : { + y : { + min: -50, + max: 200 + } + } + } }); } diff --git a/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts b/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts index 3f2dbfaf..248c9aa8 100644 --- a/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts +++ b/frontend/src/app/_elements/_charts/pie-chart/pie-chart.component.ts @@ -8,7 +8,7 @@ import {Chart} from 'chart.js'; }) export class PieChartComponent implements AfterViewInit { - @Input()width: number = 800; + @Input()width: number = 600; @Input()height: number = 450; @ViewChild('piechart') chartRef!: ElementRef; @@ -25,12 +25,17 @@ export class PieChartComponent implements AfterViewInit { data: [2478,5267,734,784,433] }] }, - /*options: { - title: { + options: { + /*title: { display: true, text: 'Predicted world population (millions) in 2050' - } - }*/ + }*/ + plugins:{ + legend: { + display: false + }, + } + } }); } |