Skip to content

Commit a4388c5

Browse files
committed
Improvement - VueUiXy - Use improved smooth path generation algorithm to avoid dips
1 parent def55b7 commit a4388c5

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/components/vue-ui-xy.vue

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,13 @@
460460
>
461461
<Shape
462462
:data-cy="`xy-plot-${i}-${j}`"
463-
v-if="canShowValue(plot.value)"
463+
v-if="plot && canShowValue(plot.value)"
464464
:shape="['triangle', 'square', 'diamond', 'pentagon', 'hexagon', 'star'].includes(serie.shape) ? serie.shape : 'circle'"
465-
:color="FINAL_CONFIG.plot.useGradient ? `url(#plotGradient_${i}_${uniqueId})` : serie.color"
465+
:color="FINAL_CONFIG.plot.useGradient ? `url(#plotGradient_${i}_${uniqueId})` : FINAL_CONFIG.plot.dot.useSerieColor ? serie.color : FINAL_CONFIG.plot.dot.fill"
466466
:plot="{ x: checkNaN(plot.x), y: checkNaN(plot.y) }"
467467
:radius="((selectedSerieIndex !== null && selectedSerieIndex === j) || (selectedMinimapIndex !== null && selectedMinimapIndex === j)) ? (plotRadii.plot || 6) * 1.5 : plotRadii.plot || 6"
468-
:stroke="FINAL_CONFIG.chart.backgroundColor"
469-
:strokeWidth="0.5"
468+
:stroke="FINAL_CONFIG.plot.dot.useSerieColor ? FINAL_CONFIG.chart.backgroundColor : serie.color"
469+
:strokeWidth="FINAL_CONFIG.plot.dot.strokeWidth"
470470
/>
471471

472472
<template v-if="plot.comment && FINAL_CONFIG.chart.comments.show">
@@ -589,11 +589,11 @@
589589
:data-cy="`xy-plot-${i}-${j}`"
590590
v-if="plot && canShowValue(plot.value)"
591591
:shape="['triangle', 'square', 'diamond', 'pentagon', 'hexagon', 'star'].includes(serie.shape) ? serie.shape : 'circle'"
592-
:color="FINAL_CONFIG.line.useGradient ? `url(#lineGradient_${i}_${uniqueId})` : serie.color"
592+
:color="FINAL_CONFIG.line.useGradient ? `url(#lineGradient_${i}_${uniqueId})` : FINAL_CONFIG.line.dot.useSerieColor ? serie.color : FINAL_CONFIG.line.dot.fill"
593593
:plot="{ x: checkNaN(plot.x), y: checkNaN(plot.y) }"
594594
:radius="((selectedSerieIndex !== null && selectedSerieIndex === j) || (selectedMinimapIndex !== null && selectedMinimapIndex === j)) ? (plotRadii.line || 6) * 1.5 : plotRadii.line || 6"
595-
:stroke="FINAL_CONFIG.chart.backgroundColor"
596-
:strokeWidth="0.5"
595+
:stroke="FINAL_CONFIG.line.dot.useSerieColor ? FINAL_CONFIG.chart.backgroundColor : serie.color"
596+
:strokeWidth="FINAL_CONFIG.line.dot.strokeWidth"
597597
/>
598598

599599
<template v-if="plot.comment && FINAL_CONFIG.chart.comments.show">
@@ -1748,6 +1748,13 @@ export default {
17481748
value: datapoint.absoluteValues[j],
17491749
comment: datapoint.comments ? datapoint.comments.slice(this.slicer.start, this.slicer.end)[j] || '' : ''
17501750
}
1751+
} else {
1752+
return {
1753+
x: this.checkNaN((this.drawingArea.left + (this.slot.line/2)) + (this.slot.line * j)),
1754+
y: zeroPosition,
1755+
value: datapoint.absoluteValues[j],
1756+
comment: datapoint.comments ? datapoint.comments.slice(this.slicer.start, this.slicer.end)[j] || '' : ''
1757+
}
17511758
}
17521759
})
17531760
const curve = this.createSmoothPath(plots);

0 commit comments

Comments
 (0)