Skip to content

Commit 252eed0

Browse files
committed
Fix - VueUiSparkbar - Fix bar overflow when >100 in percentage mode
1 parent e324189 commit 252eed0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/vue-ui-sparkbar.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,14 @@ function ratioToMax(val) {
171171
}
172172
173173
function ratioTo(bar) {
174-
175174
if (FINAL_CONFIG.value.style.layout.independant) {
176175
if (bar.target) {
177176
return bar.value / bar.target;
178177
}
179178
if (FINAL_CONFIG.value.style.layout.percentage) {
179+
if (bar.value > 100) {
180+
return 1;
181+
}
180182
return bar.value / 100;
181183
} else if(FINAL_CONFIG.value.style.layout.target === 0) {
182184
return 1;

0 commit comments

Comments
 (0)