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
|
||||
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">
|
||||
<span>{{ category.percentage }}</span>
|
||||
<span class="ml-0.5">%</span>
|
||||
</div>
|
||||
<span class="text-xs text-surface-500 dark:text-surface-400 ml-1">({{
|
||||
category.changeDiffPercentage > 0 ? '+' : category.changeDiffPercentage < 0 ? '-' : '' +
|
||||
Math.round(category.changeDiffPercentage) }})</span>
|
||||
<span class="text-xs ml-1 !w-fit"
|
||||
:class="category.changeDiffPercentage > 0 ? 'text-red-500' : 'text-green-500'">({{
|
||||
(category.changeDiffPercentage > 0 ? '+' : '') + Math.round(category.changeDiffPercentage)
|
||||
}}%)</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user