Skip to content

Commit f8c22c2

Browse files
committed
Improvement - Added line borders
1 parent 5c7a656 commit f8c22c2

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

src/components/vue-ui-quick-chart.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,15 @@ defineExpose({
954954
<template v-for="(ds, i) in line.dataset">
955955
<g class="line-plot-series">
956956
<template v-if="quickConfig.lineSmooth">
957+
<path
958+
:d="`M ${createSmoothPath(ds.coordinates)}`"
959+
:stroke="quickConfig.backgroundColor"
960+
:stroke-width="quickConfig.lineStrokeWidth + 1"
961+
stroke-linecap="round"
962+
fill="none"
963+
class="quick-animation"
964+
style="transition: all 0.3s ease-in-out"
965+
/>
957966
<path
958967
:d="`M ${createSmoothPath(ds.coordinates)}`"
959968
:stroke="ds.color"
@@ -965,6 +974,15 @@ defineExpose({
965974
/>
966975
</template>
967976
<template v-else>
977+
<path
978+
:d="`M ${ds.linePath}`"
979+
:stroke="quickConfig.backgroundColor"
980+
:stroke-width="quickConfig.lineStrokeWidth + 1"
981+
stroke-linecap="round"
982+
fill="none"
983+
class="quick-animation"
984+
style="transition: all 0.3s ease-in-out"
985+
/>
968986
<path
969987
:d="`M ${ds.linePath}`"
970988
:stroke="ds.color"

src/components/vue-ui-xy.vue

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,39 @@
242242
<path v-if="serie.smooth" :d="`M ${serie.plots[0].x},${drawingArea.bottom} ${serie.curve} L ${serie.plots.at(-1).x},${drawingArea.bottom} Z`" :fill="chartConfig.line.area.useGradient ? `url(#areaGradient_${i}_${uniqueId})` : `${serie.color}${opacity[chartConfig.line.area.opacity]}`"/>
243243
<path v-else :d="`M${serie.area}Z`" :fill="chartConfig.line.area.useGradient ? `url(#areaGradient_${i}_${uniqueId})` : `${serie.color}${opacity[chartConfig.line.area.opacity]}`"/>
244244
</g>
245-
<path :data-cy="`xy-line-area-path-${i}`" v-if="serie.smooth" :d="`M${serie.curve}`" :stroke="serie.color" :stroke-width="chartConfig.line.strokeWidth" :stroke-dasharray="serie.dashed ? chartConfig.line.strokeWidth * 2 : 0" fill="none" />
245+
<path
246+
:data-cy="`xy-line-area-path-${i}`"
247+
v-if="serie.smooth"
248+
:d="`M${serie.curve}`"
249+
:stroke="chartConfig.chart.backgroundColor"
250+
:stroke-width="chartConfig.line.strokeWidth + 1"
251+
:stroke-dasharray="serie.dashed ? chartConfig.line.strokeWidth * 2 : 0"
252+
fill="none"
253+
/>
254+
<path
255+
:data-cy="`xy-line-area-path-${i}`"
256+
v-if="serie.smooth"
257+
:d="`M${serie.curve}`"
258+
:stroke="serie.color"
259+
:stroke-width="chartConfig.line.strokeWidth"
260+
:stroke-dasharray="serie.dashed ? chartConfig.line.strokeWidth * 2 : 0"
261+
fill="none"
262+
/>
246263
<g v-else>
247264
<g v-for="(plot, j) in serie.plots" :key="`line_${i}_${j}`">
265+
<line
266+
:data-cy="`xy-line-segment-${i}-${j}`"
267+
v-if="j < serie.plots.length - 1 && canShowValue(plot.value) && canShowValue(serie.plots[j+1].value)"
268+
:x1="plot.x"
269+
:x2="serie.plots[j+1].x"
270+
:y1="plot.y"
271+
:y2="serie.plots[j+1].y"
272+
:stroke="chartConfig.chart.backgroundColor"
273+
:stroke-width="chartConfig.line.strokeWidth + 1"
274+
:stroke-dasharray="serie.dashed ? chartConfig.line.strokeWidth * 2 : 0"
275+
stroke-linejoin="round"
276+
stroke-linecap="round"
277+
/>
248278
<line
249279
:data-cy="`xy-line-segment-${i}-${j}`"
250280
v-if="j < serie.plots.length - 1 && canShowValue(plot.value) && canShowValue(serie.plots[j+1].value)"

0 commit comments

Comments
 (0)