Skip to content

Commit decee1e

Browse files
committed
Fix - VueUiGauge - Always start animation from the smallest from value
1 parent 8cc2ed5 commit decee1e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/vue-ui-gauge.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ const svg = ref({
166166
const max = ref(0);
167167
const min = ref(0);
168168
169-
const activeRating = ref(FINAL_CONFIG.value.style.chart.animation.use ? 0 : props.dataset.value);
169+
const activeRating = ref(
170+
FINAL_CONFIG.value.style.chart.animation.use
171+
? Math.min(...props.dataset.series.map(s => s.from))
172+
: props.dataset.value
173+
);
170174
171175
watch(() => props.dataset.value, () => {
172176
useAnimation(props.dataset.value);

0 commit comments

Comments
 (0)