Skip to content

Commit 50eeef7

Browse files
committed
fix: apply appropriate gradient on bars
1 parent e16dd25 commit 50eeef7

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

app/components/Package/VersionDistribution.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ const chartConfig = computed(() => {
212212
backgroundColor: 'transparent',
213213
customFormat: (params: TooltipParams) => {
214214
const { datapoint, absoluteIndex, bars } = params
215-
if (!datapoint) return ''
215+
if (!datapoint || pending.value) return ''
216216
217217
// Use absoluteIndex to get the correct version from chartDataset
218218
const index = Number(absoluteIndex)
@@ -496,11 +496,12 @@ const endDate = computed(() => {
496496
/>
497497
</template>
498498

499-
<!-- Subtle gradient applied for area charts -->
500-
<template #area-gradient="{ series: chartModalSeries, id: gradientId }">
501-
<linearGradient :id="gradientId" x1="0" x2="0" y1="0" y2="1">
502-
<stop offset="0%" :stop-color="chartModalSeries.color" stop-opacity="0.2" />
503-
<stop offset="100%" :stop-color="colors.bg" stop-opacity="0" />
499+
<!-- Custom bar gradient based on the series color -->
500+
<template #bar-gradient="{ series, positiveId }">
501+
<linearGradient :id="positiveId" x1="0" x2="0" y1="0" y2="1">
502+
<!-- vue-data-ui exposes hex-normalized colors -->
503+
<stop offset="0%" :stop-color="lightenHex(series.color, 0.618)" />
504+
<stop offset="100%" :stop-color="series.color" stop-opacity="0.618" />
504505
</linearGradient>
505506
</template>
506507

0 commit comments

Comments
 (0)