Skip to content

Commit

Permalink
Make donut chart colors based on the choosen matrix colors
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag authored and eric-intuitem committed Feb 25, 2024
1 parent 95d6365 commit 89d10f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions frontend/src/routes/(app)/analytics/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
name="current_risk"
s_label={cur_rsk_label}
values={risk_level.current}
colors={RISK_COLOR_PALETTE}
colors={risk_level.current.map(object => object.color)}
/>
</div>
<div class="h-96 p-2 m-2 w-1/3">
Expand All @@ -319,7 +319,7 @@
name="residual_risk"
s_label={rsd_rsk_label}
values={risk_level.residual}
colors={RISK_COLOR_PALETTE}
colors={risk_level.residual.map(object => object.color)}
/>
</div>
<div class="h-96 p-2 m-2 w-1/3">
Expand Down Expand Up @@ -622,6 +622,7 @@ c0.27-0.268,0.707-0.268,0.979,0l7.908,7.83c0.27,0.268,0.27,0.701,0,0.969c-0.271,
name="compliance_assessments"
s_label={m.complianceAssessments()}
values={compliance_assessment.donut.values}
colors={compliance_assessment.donut.values.map(object => object.itemStyle.color)}
/>
</div>
<div class="absolute top-0 right-0 mt-2 space-x-1">
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/routes/(app)/analytics/composer/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
name="current_risk_level"
s_label="Current risk level per risk scenario"
values={data.current_level}
colors={RISK_COLOR_PALETTE}
colors={data.current_level.map(object => object.color)}
/>
</div>
</div>
Expand All @@ -56,7 +56,7 @@
name="residual_risk_level"
s_label="Residual risk level per risk scenario"
values={data.residual_level}
colors={RISK_COLOR_PALETTE}
colors={data.residual_level.map(object => object.color)}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
name="compliance_assessments"
s_label="compliance_assessments"
values={compliance_assessment_donut_values.values}
colors={compliance_assessment_donut_values.values.map(object => object.itemStyle.color)}
/>
</div>
<div class="flex flex-row space-x-2 ml-4">
Expand Down

0 comments on commit 89d10f7

Please sign in to comment.