diff --git a/src/app/components/fixedvar-results/fixedvar-results.component.html b/src/app/components/fixedvar-results/fixedvar-results.component.html index 0b7fc09fc5ae489d93a4520fb4c4083a83c2cae9..7676b026859cc72cbef157cf5b94edaa9a57d1d4 100644 --- a/src/app/components/fixedvar-results/fixedvar-results.component.html +++ b/src/app/components/fixedvar-results/fixedvar-results.component.html @@ -2,7 +2,7 @@ <!-- journal --> <log></log> - <results-chart *ngIf="showVarResults"></results-chart> + <results-chart [hidden]="! showVarResultsChart"></results-chart> <div> <!-- table des résultats fixés --> diff --git a/src/app/components/fixedvar-results/fixedvar-results.component.ts b/src/app/components/fixedvar-results/fixedvar-results.component.ts index 813d377388bd7df11008b45f2c7e470ebfb53494..58bbbf90ce9027236b72fed848e2bbc46a772dbf 100644 --- a/src/app/components/fixedvar-results/fixedvar-results.component.ts +++ b/src/app/components/fixedvar-results/fixedvar-results.component.ts @@ -167,6 +167,13 @@ export class FixedVarResultsComponent extends ResultsComponent implements DoChec return this._varResults && this._varResults.hasResults; } + /** + * affichage du graphique des résultats variés + */ + public get showVarResultsChart(): boolean { + return this._varResults && this._varResults.hasPlottableResults; + } + public getFixedResultClass(i: number) { // tslint:disable-next-line:no-bitwise return "result_id_" + String(i & 1); diff --git a/src/app/results/param-calc-results.ts b/src/app/results/param-calc-results.ts index 60c0e257d0b40dd636f2d1ab62cb6e9964382674..3f5c8c4b0e8364c7e2486e6300f8103a4304dff4 100644 --- a/src/app/results/param-calc-results.ts +++ b/src/app/results/param-calc-results.ts @@ -36,6 +36,15 @@ export abstract class CalculatedParamResults extends CalculatorResults { } public get hasResults(): boolean { + if (this.result === undefined) { + return false; + } + return true; + // return ! this.result.hasOnlyErrors; + } + + /** return true if there is something to display on the variable results chart */ + public get hasPlottableResults(): boolean { if (this.result === undefined) { return false; }