Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results pages chart sizing #4352

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h3 class="text-center">{{t('reports.core.dashboard.score')}}</h3>
<div class="d-flex flex-column flex-00a mb-5">
<h3 class="text-center">{{t('titles.assessment compliance')}}</h3>
<p [innerHTML]="t('reports.assessment compliance text')"></p>
<canvas id="canvasAssessmentCompliance">{{assessComplChart}}</canvas>
<canvas id="canvasAssessmentCompliance" height="200" width="700">{{assessComplChart}}</canvas>
</div>


Expand All @@ -76,7 +76,7 @@ <h3 class="text-center">{{t('titles.ranked categories')}}</h3>

<p>{{t('reports.ranked categories text 1b')}}</p>

<canvas id="canvasTopCategories">{{topCategChart}}</canvas>
<canvas id="canvasTopCategories" height="300" width="700">{{topCategChart}}</canvas>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@
-------------------------->
<div class="white-panel d-flex flex-column justify-content-start flex-11a" *transloco="let t">
<h3>{{t('titles.ranked categories')}}</h3>
<p class="fst-italic" [class.d-none]="showChart">

<div *ngIf="!initialized">
<div class="spinner-container" style="margin-left: auto; margin-right: auto;">
<div style="max-width: 50px; max-height: 50px;"></div>
</div>
</div>

<p class="fst-italic" *ngIf="initialized && !chartIsVisible">
{{t('reports.core.no ranking')}}
</p>
<div [class.d-none]="!showChart">

<div [class.d-none]="!chartIsVisible">
<p>{{t('reports.ranked categories text 1a')}}</p>

<p>{{t('reports.ranked categories text 1b')}}</p>
Expand All @@ -34,12 +42,6 @@ <h3>{{t('titles.ranked categories')}}</h3>
<canvas id="canvasStandardRank">{{chart}}</canvas>
</div>

<div *ngIf="!initialized">
<div class="spinner-container" style="margin-left: auto; margin-right: auto;">
<div style="max-width: 50px; max-height: 50px;"></div>
</div>
</div>

<div class="data" [hidden]="!initialized">
<p>{{t('reports.ranked categories text 2')}}</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { TranslocoService } from '@jsverse/transloco';
host: { class: 'd-flex flex-column flex-11a' }
})
export class StandardsRankedComponent implements OnInit {
showChart = false;
chartIsVisible = false;
chart: Chart;
dataRows: { title: string; rank: string; failed: number; total: number; percent: string; }[];
initialized = false;
Expand All @@ -55,7 +55,7 @@ export class StandardsRankedComponent implements OnInit {

setupChart(x: any) {
// only show the chart if there is some non-zero data to show
this.showChart = x.data.some(x => x > 0);
this.chartIsVisible = x.data.some(x => x > 0);

if (this.chart) {
this.chart.destroy();
Expand Down
4 changes: 4 additions & 0 deletions CSETWebNg/src/app/services/analysis.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ export class AnalysisService {
],
},
options: {
responsive: false,
maintainAspectRatio: false,
indexAxis: 'y',
plugins: {
title: {
Expand Down Expand Up @@ -187,6 +189,8 @@ export class AnalysisService {
],
},
options: {
responsive: false,
maintainAspectRatio: false,
indexAxis: 'y',
plugins: {
title: {
Expand Down
Loading