feat: improve percentage change display with dynamic colors and width adjustments.
This commit is contained in:
@@ -199,14 +199,15 @@ const weeklyChartOptions = computed(() => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex items-center text-sm gap-1 text-surface-500 dark:text-surface-400 w-10 text-right">
|
class="flex items-center text-sm gap-1 text-surface-500 dark:text-surface-400 w-10 text-right !w-full">
|
||||||
<div class="flex items-center gap-0">
|
<div class="flex items-center gap-0">
|
||||||
<span>{{ category.percentage }}</span>
|
<span>{{ category.percentage }}</span>
|
||||||
<span class="ml-0.5">%</span>
|
<span class="ml-0.5">%</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="text-xs text-surface-500 dark:text-surface-400 ml-1">({{
|
<span class="text-xs ml-1 !w-fit"
|
||||||
category.changeDiffPercentage > 0 ? '+' : category.changeDiffPercentage < 0 ? '-' : '' +
|
:class="category.changeDiffPercentage > 0 ? 'text-red-500' : 'text-green-500'">({{
|
||||||
Math.round(category.changeDiffPercentage) }})</span>
|
(category.changeDiffPercentage > 0 ? '+' : '') + Math.round(category.changeDiffPercentage)
|
||||||
|
}}%)</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user