|
642 | 642 | stroke-linejoin="round"
|
643 | 643 | />
|
644 | 644 |
|
645 |
| - <g v-for="(plot, j) in serie.plots" |
| 645 | + <template v-for="(plot, j) in serie.plots" |
646 | 646 | :key="`circle_line_${i}_${j}`">
|
647 | 647 | <Shape
|
648 | 648 | :data-cy="`xy-plot-${i}-${j}`"
|
|
662 | 662 | </div>
|
663 | 663 | </foreignObject>
|
664 | 664 | </template>
|
| 665 | + </template> |
665 | 666 |
|
666 |
| - </g > |
667 | 667 | <g :data-cy="`xy-line-progression-${i}`" v-if="Object.hasOwn(serie, 'useProgression') && serie.useProgression === true && !isNaN(calcLinearProgression(serie.plots).trend)">
|
668 | 668 | <defs>
|
669 | 669 | <marker :id="`line_arrow_${i}`" :markerWidth="7" :markerHeight="7"
|
|
705 | 705 |
|
706 | 706 | <!-- X LABELS BAR -->
|
707 | 707 | <g v-if="(FINAL_CONFIG.bar.labels.show || FINAL_CONFIG.bar.serieName.show) && mutableConfig.dataLabels.show">
|
708 |
| - <g v-for="(serie, i) in barSet" :key="`xLabel_bar_${i}`" :class="`xLabel_bar_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
709 |
| - <g v-for="(plot, j) in serie.plots" :key="`xLabel_bar_${i}_${j}`"> |
| 708 | + <template v-for="(serie, i) in barSet" :key="`xLabel_bar_${i}`" :class="`xLabel_bar_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
| 709 | + <template v-for="(plot, j) in serie.plots" :key="`xLabel_bar_${i}_${j}`"> |
710 | 710 | <text
|
711 | 711 | :data-cy="`xy-bar-label-x-${i}-${j}`"
|
712 | 712 | v-if="plot && (!Object.hasOwn(serie, 'dataLabels') || ((serie.dataLabels === true || (selectedSerieIndex !== null && selectedSerieIndex === j) || (selectedMinimapIndex !== null && selectedMinimapIndex === j)))) && FINAL_CONFIG.bar.labels.show"
|
|
743 | 743 | >
|
744 | 744 | {{ FINAL_CONFIG.bar.serieName.useAbbreviation ? abbreviate({ source: serie.name, length: FINAL_CONFIG.bar.serieName.abbreviationSize}) : serie.name }}
|
745 | 745 | </text>
|
746 |
| - </g> |
747 |
| - </g> |
| 746 | + </template> |
| 747 | + </template> |
748 | 748 | </g>
|
749 | 749 |
|
750 | 750 | <!-- X LABELS PLOT -->
|
751 | 751 | <g v-if="FINAL_CONFIG.plot.labels.show && mutableConfig.dataLabels.show">
|
752 |
| - <g v-for="(serie, i) in plotSet" :key="`xLabel_plot_${i}`" :class="`xLabel_plot_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
753 |
| - <g v-for="(plot, j) in serie.plots" :key="`xLabel_plot_${i}_${j}`"> |
| 752 | + <template v-for="(serie, i) in plotSet" :key="`xLabel_plot_${i}`" :class="`xLabel_plot_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
| 753 | + <template v-for="(plot, j) in serie.plots" :key="`xLabel_plot_${i}_${j}`"> |
754 | 754 | <text
|
755 | 755 | :data-cy="`xy-plot-label-x-${i}-${j}`"
|
756 | 756 | v-if="plot && !Object.hasOwn(serie, 'dataLabels') || (serie.dataLabels === true || (selectedSerieIndex !== null && selectedSerieIndex === j) || (selectedMinimapIndex !== null && selectedMinimapIndex === j))"
|
|
802 | 802 | {{ serie.name }}
|
803 | 803 | </div>
|
804 | 804 | </foreignObject>
|
805 |
| - </g> |
806 |
| - </g> |
| 805 | + </template> |
| 806 | + </template> |
807 | 807 | </g>
|
808 | 808 |
|
809 | 809 | <!-- X LABELS LINE -->
|
810 | 810 | <g v-if="FINAL_CONFIG.line.labels.show && mutableConfig.dataLabels.show">
|
811 |
| - <g v-for="(serie, i) in lineSet" :key="`xLabel_line_${i}`" :class="`xLabel_line_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
812 |
| - <g v-for="(plot, j) in serie.plots" :key="`xLabel_line_${i}_${j}`"> |
| 811 | + <template v-for="(serie, i) in lineSet" :key="`xLabel_line_${i}`" :class="`xLabel_line_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
| 812 | + <template v-for="(plot, j) in serie.plots" :key="`xLabel_line_${i}_${j}`"> |
813 | 813 | <text
|
814 | 814 | :data-cy="`xy-line-label-x-${i}-${j}`"
|
815 | 815 | v-if="plot && !Object.hasOwn(serie, 'dataLabels') || (serie.dataLabels === true || (selectedSerieIndex !== null && selectedSerieIndex === j) || (selectedMinimapIndex !== null && selectedMinimapIndex === j))"
|
|
861 | 861 | {{ serie.name }}
|
862 | 862 | </div>
|
863 | 863 | </foreignObject>
|
864 |
| - </g> |
865 |
| - </g> |
| 864 | + </template> |
| 865 | + </template> |
866 | 866 | </g>
|
867 | 867 |
|
868 | 868 | <!-- SERIE NAME TAGS : LINES -->
|
869 |
| - <g v-for="(serie, i) in lineSet" :key="`xLabel_line_${i}`" :class="`xLabel_line_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
870 |
| - <g v-for="(plot, j) in serie.plots" :key="`xLabel_line_${i}_${j}`"> |
| 869 | + <template v-for="(serie, i) in lineSet" :key="`xLabel_line_${i}`" :class="`xLabel_line_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
| 870 | + <template v-for="(plot, j) in serie.plots" :key="`xLabel_line_${i}_${j}`"> |
871 | 871 | <text
|
872 | 872 | v-if="plot && j === 0 && serie.showSerieName && serie.showSerieName === 'start'"
|
873 | 873 | :x="plot.x - fontSizes.plotLabels"
|
|
900 | 900 | maxWords: 2
|
901 | 901 | })"
|
902 | 902 | />
|
903 |
| - </g> |
904 |
| - </g> |
| 903 | + </template> |
| 904 | + </template> |
905 | 905 |
|
906 | 906 | <!-- SERIE NAME TAGS : PLOTS -->
|
907 |
| - <g v-for="(serie, i) in plotSet" :key="`xLabel_plot_${i}`" :class="`xLabel_plot_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
908 |
| - <g v-for="(plot, j) in serie.plots" :key="`xLabel_plot_${i}_${j}`"> |
| 907 | + <template v-for="(serie, i) in plotSet" :key="`xLabel_plot_${i}`" :class="`xLabel_plot_${i}`" :style="`opacity:${selectedScale ? selectedScale === serie.id ? 1 : 0.2 : 1};transition:opacity 0.2s ease-in-out`"> |
| 908 | + <template v-for="(plot, j) in serie.plots" :key="`xLabel_plot_${i}_${j}`"> |
909 | 909 | <text
|
910 | 910 | v-if="plot && j === 0 && serie.showSerieName && serie.showSerieName === 'start'"
|
911 | 911 | :x="plot.x - fontSizes.plotLabels"
|
|
938 | 938 | maxWords: 2
|
939 | 939 | })"
|
940 | 940 | />
|
941 |
| - </g> |
942 |
| - </g> |
| 941 | + </template> |
| 942 | + </template> |
943 | 943 |
|
944 | 944 | <!-- Y LABELS MOUSE TRAPS -->
|
945 | 945 | <template v-if="mutableConfig.useIndividualScale && !mutableConfig.isStacked">
|
|
979 | 979 | >
|
980 | 980 | {{ FINAL_CONFIG.chart.grid.labels.axis.xLabel }}
|
981 | 981 | </text>
|
982 |
| - </g> |
| 982 | + </g>v-for="(label, i) in timeLabels" :key="`time_label_${i}`" |
983 | 983 |
|
984 | 984 | <!-- TIME LABELS -->
|
985 | 985 | <g v-if="FINAL_CONFIG.chart.grid.labels.xAxisLabels.show">
|
986 | 986 | <template v-if="$slots['time-label']">
|
987 |
| - <g v-for="(label, i) in timeLabels" :key="`time_label_${i}`"> |
| 987 | + <template v-for="(label, i) in timeLabels" :key="`time_label_${i}`"> |
988 | 988 | <slot name="time-label" v-bind="{
|
989 | 989 | x: drawingArea.left + (drawingArea.width / maxSeries) * i + (drawingArea.width / maxSeries / 2),
|
990 | 990 | y: drawingArea.bottom + fontSizes.xAxis * 1.3 + FINAL_CONFIG.chart.grid.labels.xAxisLabels.yOffset,
|
|
999 | 999 | (label && FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && selectedSerieIndex === i && !FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo) ||
|
1000 | 1000 | (label && !FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyFirstAndLast && FINAL_CONFIG.chart.grid.labels.xAxisLabels.showOnlyAtModulo && (i % Math.floor((this.slicer.end - this.slicer.start) / FINAL_CONFIG.chart.grid.labels.xAxisLabels.modulo) === 0))
|
1001 | 1001 | }" />
|
1002 |
| - </g> |
| 1002 | + </template> |
1003 | 1003 | </template>
|
1004 | 1004 | <template v-else>
|
1005 | 1005 | <g v-for="(label, i) in timeLabels" :key="`time_label_${i}`">
|
|
1028 | 1028 |
|
1029 | 1029 | <!-- TOOLTIP TRAPS -->
|
1030 | 1030 | <g>
|
1031 |
| - <g v-for="(_, i) in maxSeries" :key="`tooltip_trap_${i}`"> |
1032 |
| - <rect |
1033 |
| - :data-cy="`xy-tooltip-trap-${i}`" |
1034 |
| - data-cy-trap |
1035 |
| - :x="drawingArea.left + (drawingArea.width / maxSeries) * i" |
1036 |
| - :y="drawingArea.top" |
1037 |
| - :height="drawingArea.height < 0 ? 10 : drawingArea.height" |
1038 |
| - :width="drawingArea.width / maxSeries < 0 ? 0.00001 : drawingArea.width / maxSeries" |
1039 |
| - fill="transparent" |
1040 |
| - @mouseenter="toggleTooltipVisibility(true, i)" |
1041 |
| - @mouseleave="toggleTooltipVisibility(false)" |
1042 |
| - @click="selectX(i)" |
1043 |
| - /> |
1044 |
| - </g> |
| 1031 | + <rect |
| 1032 | + v-for="(_, i) in maxSeries" :key="`tooltip_trap_${i}`" |
| 1033 | + :data-cy="`xy-tooltip-trap-${i}`" |
| 1034 | + data-cy-trap |
| 1035 | + :x="drawingArea.left + (drawingArea.width / maxSeries) * i" |
| 1036 | + :y="drawingArea.top" |
| 1037 | + :height="drawingArea.height < 0 ? 10 : drawingArea.height" |
| 1038 | + :width="drawingArea.width / maxSeries < 0 ? 0.00001 : drawingArea.width / maxSeries" |
| 1039 | + fill="transparent" |
| 1040 | + @mouseenter="toggleTooltipVisibility(true, i)" |
| 1041 | + @mouseleave="toggleTooltipVisibility(false)" |
| 1042 | + @click="selectX(i)" |
| 1043 | + /> |
1045 | 1044 | </g>
|
1046 | 1045 |
|
| 1046 | + |
1047 | 1047 | <!-- TIME TAG -->
|
1048 |
| - <g v-if="FINAL_CONFIG.chart.timeTag.show && (![null, undefined].includes(selectedSerieIndex) || ![null, undefined].includes(selectedMinimapIndex) )"> |
| 1048 | + <g v-if="FINAL_CONFIG.chart.timeTag.show && (![null, undefined].includes(selectedSerieIndex) || ![null, undefined].includes(selectedMinimapIndex) )" style="pointer-events:none"> |
1049 | 1049 | <foreignObject
|
1050 | 1050 | :x="drawingArea.left + (drawingArea.width / maxSeries) * ((selectedSerieIndex !== null ? selectedSerieIndex : 0) || (selectedMinimapIndex !== null ? selectedMinimapIndex : 0)) - 100 + (drawingArea.width / maxSeries / 2)"
|
1051 | 1051 | :y="drawingArea.bottom"
|
|
0 commit comments