Skip to content

Commit f2c7581

Browse files
committed
Improvement - VueUiXy - Expose seriesIndex and datapointIndex in plot-comment slot
1 parent 7534f40 commit f2c7581

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/vue-ui-xy.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271

272272
<template v-if="plot.comment && FINAL_CONFIG.chart.comments.show">
273273
<foreignObject style="overflow: visible" height="12" :width="(calcRectWidth() - (mutableConfig.useIndividualScale && mutableConfig.isStacked ? 0 : barPeriodGap) < 0 ? 0.00001 : calcRectWidth() - (mutableConfig.useIndividualScale && mutableConfig.isStacked ? 0 : barPeriodGap) / 2) + FINAL_CONFIG.chart.comments.width" :x="calcRectX(plot) - (FINAL_CONFIG.chart.comments.width / 2) + FINAL_CONFIG.chart.comments.offsetX" :y="checkNaN(plot.y) + FINAL_CONFIG.chart.comments.offsetY + 6">
274-
<slot name="plot-comment" :plot="{...plot, color: serie.color}"/>
274+
<slot name="plot-comment" :plot="{...plot, color: serie.color, seriesIndex: i, datapointIndex: j }"/>
275275
</foreignObject>
276276
</template>
277277
</g>
@@ -473,7 +473,7 @@
473473
<template v-if="plot.comment && FINAL_CONFIG.chart.comments.show">
474474
<foreignObject style="overflow: visible" height="12" :width="FINAL_CONFIG.chart.comments.width" :x="plot.x - (FINAL_CONFIG.chart.comments.width / 2) + FINAL_CONFIG.chart.comments.offsetX" :y="plot.y + FINAL_CONFIG.chart.comments.offsetY + 6">
475475
<div style="width: 100%;">
476-
<slot name="plot-comment" :plot="{...plot, color: serie.color}"/>
476+
<slot name="plot-comment" :plot="{...plot, color: serie.color, seriesIndex: i, datapointIndex: j }"/>
477477
</div>
478478
</foreignObject>
479479
</template>
@@ -600,7 +600,7 @@
600600
<template v-if="plot.comment && FINAL_CONFIG.chart.comments.show">
601601
<foreignObject style="overflow: visible" height="12" :width="FINAL_CONFIG.chart.comments.width" :x="plot.x - (FINAL_CONFIG.chart.comments.width / 2) + FINAL_CONFIG.chart.comments.offsetX" :y="plot.y + FINAL_CONFIG.chart.comments.offsetY + 6">
602602
<div style="width: 100%;">
603-
<slot name="plot-comment" :plot="{...plot, color: serie.color}"/>
603+
<slot name="plot-comment" :plot="{...plot, color: serie.color, seriesIndex: i, datapointIndex: j }"/>
604604
</div>
605605
</foreignObject>
606606
</template>

0 commit comments

Comments
 (0)