Skip to content

Commit

Permalink
chore: set provider color to provider data (#3026)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuda110 authored Jan 29, 2024
1 parent 23587b7 commit 85a65ce
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ const state = reactive({
const _categoryLabel = state.selectedTarget === GROUP_BY.WORKSPACE
? storeState.workspaces[_category]?.label ?? d.workspace_id
: storeState.providers[_category]?.name ?? d.provider;
const _color = state.selectedTarget === GROUP_BY.WORKSPACE
? DEFAULT_CHART_COLORS[idx]
: storeState.providers[_category]?.color ?? DEFAULT_CHART_COLORS[idx];
return {
category: _categoryLabel,
value: d.value_sum,
pieSettings: {
fill: DEFAULT_CHART_COLORS[idx],
fill: _color,
},
};
})),
Expand Down Expand Up @@ -254,7 +257,7 @@ watch([() => state.currentDate, () => state.selectedTarget, () => costReportPage
</span>
<span v-else-if="field.name === GROUP_BY.PROVIDER">
<span class="toggle-button"
:style="{ 'background-color': DEFAULT_CHART_COLORS[rowIndex] }"
:style="{ 'background-color': storeState.providers[value]?.color ?? DEFAULT_CHART_COLORS[rowIndex] }"
/>
{{ storeState.providers[value] ? storeState.providers[value].name : value }}
</span>
Expand Down

0 comments on commit 85a65ce

Please sign in to comment.