Skip to content

Commit b871c13

Browse files
committed
Improvement - VueUiXy improve style of selected scale in individualScale mode
1 parent 4c8392f commit b871c13

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/components/vue-ui-xy.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,13 +960,26 @@
960960

961961
<!-- Y LABELS MOUSE TRAPS -->
962962
<template v-if="mutableConfig.useIndividualScale && !mutableConfig.isStacked">
963+
<defs>
964+
<linearGradient
965+
v-for="(trap, i) in allScales"
966+
:id="`individual_scale_gradient_${uniqueId}_${i}`"
967+
x1="0%"
968+
x2="100%"
969+
y1="0%"
970+
y2="0%"
971+
>
972+
<stop offset="0%" :stop-color="FINAL_CONFIG.chart.backgroundColor" stop-opacity="0"/>
973+
<stop offset="100%" :stop-color="trap.color" stop-opacity="0.2"/>
974+
</linearGradient>
975+
</defs>
963976
<rect
964-
v-for="trap in allScales"
977+
v-for="(trap, i) in allScales"
965978
:x="trap.x - FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth + xPadding"
966979
:y="drawingArea.top"
967980
:width="FINAL_CONFIG.chart.grid.labels.yAxis.labelWidth"
968981
:height="drawingArea.height < 0 ? 10 : drawingArea.height"
969-
:fill="selectedScale === trap.id ? setOpacity(trap.color, 20) : 'transparent'"
982+
:fill="selectedScale === trap.id ? `url(#individual_scale_gradient_${uniqueId}_${i})` : 'transparent'"
970983
@mouseenter="selectedScale = trap.id"
971984
@mouseleave="selectedScale = null"
972985
/>

0 commit comments

Comments
 (0)