File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff 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+
198212const 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"
You can’t perform that action at this time.
0 commit comments