Skip to content

Commit 3cf945d

Browse files
committed
Fix - VueUiStripPlot - Fixed wrong scaling
1 parent 8a2f6fe commit 3cf945d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/components/vue-ui-strip-plot.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ const scale = computed(() => {
195195
return calculateNiceScale(extremes.value.min < 0 ? extremes.value.min : 0, extremes.value.max, stripConfig.value.style.chart.grid.scaleSteps);
196196
})
197197
198+
const drawableDataset = computed(() => {
199+
return (mutableDataset.value || []).map((ds, i) => {
200+
return {
201+
...ds,
202+
plots: ds.plots.map((p) => {
203+
return {
204+
...p,
205+
y: drawingArea.value.bottom -(((p.value + scale.value.min) / (scale.value.max + scale.value.min)) * drawingArea.value.height)
206+
}
207+
})
208+
}
209+
})
210+
});
211+
198212
const yLines = computed(() => {
199213
return scale.value.ticks.map(t => {
200214
return {
@@ -568,7 +582,7 @@ defineExpose({
568582
<stop offset="100%" :stop-color="ds.color"/>
569583
</radialGradient>
570584
</defs>
571-
<template v-for="(ds, S) in mutableDataset">
585+
<template v-for="(ds, S) in drawableDataset">
572586
<!--FIXME: Animation only works on circles, as y is direct and dynamic whereas other shapes build paths -->
573587
<Shape
574588
v-for="(plot, i) in ds.plots"

0 commit comments

Comments
 (0)