@@ -431,14 +431,13 @@ <h1>{{ t('title') }}</h1>
431431 </ mat-card-content >
432432 </ mat-card >
433433
434- < mat-card *ngIf ="chartData " class ="charts-card ">
434+ < mat-card *ngIf ="averageTaxRateChartData " class ="charts-card ">
435435 < mat-card-header >
436436 < mat-card-title > {{ t('average_tax_rate_evolution') }}</ mat-card-title >
437437 </ mat-card-header >
438438
439439 < mat-card-content #ContainerRef >
440440 < ngx-charts-line-chart
441- *ngIf ="averageTaxRateChartData "
442441 [view] ="[ContainerRef.offsetWidth - 32, max(min(400, window.innerHeight - 16), 300)] "
443442 [scheme] ="'vivid' "
444443 [results] ="averageTaxRateChartData "
@@ -479,7 +478,7 @@ <h1>{{ t('title') }}</h1>
479478 </ mat-card-content >
480479 </ mat-card >
481480
482- < mat-card *ngIf ="chartData " class ="charts-card ">
481+ < mat-card *ngIf ="relativeChartData " class ="charts-card ">
483482 < mat-card-header >
484483 < mat-card-title > {{ t('relative_net_increase_title', {amount: formatAmount(graphsStep) }) }}</ mat-card-title >
485484 < mat-card-subtitle >
@@ -490,7 +489,6 @@ <h1>{{ t('title') }}</h1>
490489
491490 < mat-card-content #ContainerRef >
492491 < ngx-charts-line-chart
493- *ngIf ="relativeChartData "
494492 [view] ="[ContainerRef.offsetWidth - 32, max(min(400, window.innerHeight - 16), 300)] "
495493 [scheme] ="'vivid' "
496494 [results] ="relativeChartData "
@@ -539,11 +537,18 @@ <h1>{{ t('title') }}</h1>
539537 </ mat-card-header >
540538
541539 < mat-card-content #ContainerRef >
540+ < mat-slide-toggle
541+ class ="m-b "
542+ [checked] ="showTaxDataAsProportionalToGross "
543+ (change) ="showTaxDataAsProportionalToGross = $event.checked ">
544+ {{ t('proportional_to_gross' ) }}
545+ </ mat-slide-toggle >
546+
542547 < ngx-charts-area-chart-stacked
543548 *ngIf ="taxData "
544549 [view] ="[ContainerRef.offsetWidth - 32, max(min(400, window.innerHeight - 16), 300)] "
545550 [scheme] ="'vivid' "
546- [results] ="taxData "
551+ [results] ="showTaxDataAsProportionalToGross ? taxDataProportionalToGross : taxData "
547552 [xAxis] ="true "
548553 [yAxis] ="true "
549554 [legend] ="true "
@@ -553,7 +558,7 @@ <h1>{{ t('title') }}</h1>
553558 [showGridLines] ="true "
554559 [roundDomains] ="true "
555560 [xAxisTickFormatting] ="formatAmountTickFormattingFn "
556- [yAxisTickFormatting] ="formatAmountTickFormattingFn "
561+ [yAxisTickFormatting] ="showTaxDataAsProportionalToGross ? formatPctTickFormattingFn : formatAmountTickFormattingFn "
557562 [legendPosition] ="legendPosition "
558563 [legendTitle] ="'' "
559564 [ngClass] ="{'legend-below': legendPosition === LegendPosition.Below} "
@@ -562,7 +567,12 @@ <h1>{{ t('title') }}</h1>
562567 [tooltipDisabled] ="false ">
563568 < ng-template #tooltipTemplate let-model ="model ">
564569 < div class ="tooltip-label "> {{formatAmount(model.name)}}</ div >
565- < div class ="tooltip-val "> {{ model.series }}: {{formatAmount(model.value)}}</ div >
570+
571+ @if (showTaxDataAsProportionalToGross) {
572+ < div class ="tooltip-val "> {{ model.series }}: {{formatPct(model.value)}}</ div >
573+ } @else {
574+ < div class ="tooltip-val "> {{ model.series }}: {{formatAmount(model.value)}}</ div >
575+ }
566576 </ ng-template >
567577
568578 < ng-template #seriesTooltipTemplate let-series ="model ">
@@ -573,7 +583,12 @@ <h1>{{ t('title') }}</h1>
573583 @for (singleSeries of series; track $index) {
574584 < div class ="tooltip-item ">
575585 < div class ="tooltip-item-color " [style] ="{'background-color': singleSeries.color} "> </ div >
576- < span > {{singleSeries.series}}: {{formatAmount(singleSeries.value)}}</ span >
586+
587+ @if (showTaxDataAsProportionalToGross) {
588+ < span > {{singleSeries.series}}: {{formatPct(singleSeries.value)}}</ span >
589+ } @else {
590+ < span > {{singleSeries.series}}: {{formatAmount(singleSeries.value)}}</ span >
591+ }
577592 </ div >
578593 }
579594 </ ng-template >
@@ -588,7 +603,6 @@ <h1>{{ t('title') }}</h1>
588603
589604 < mat-card-content #ContainerRef >
590605 < ngx-charts-area-chart-stacked
591- *ngIf ="taxDataProportional "
592606 [view] ="[ContainerRef.offsetWidth - 32, max(min(400, window.innerHeight - 16), 300)] "
593607 [scheme] ="'vivid' "
594608 [results] ="taxDataProportional "
0 commit comments