@@ -291,6 +291,12 @@ function segregateDonut(arc, ds) {
291291 }
292292}
293293
294+ const commonSelectedIndex = ref (null );
295+
296+ function setCommonSelectedIndex (index ) {
297+ commonSelectedIndex .value = index;
298+ }
299+
294300const donut = computed (() => {
295301 if (chartType .value !== detector .chartType .DONUT ) return null ;
296302 const ds = formattedDataset .value .dataset .map ((ds , i ) => {
@@ -373,6 +379,7 @@ const donut = computed(() => {
373379 function killTooltip () {
374380 isTooltip .value = false ;
375381 selectedDatapoint .value = null ;
382+ commonSelectedIndex .value = null ;
376383 }
377384
378385 const drawingArea = {
@@ -561,6 +568,7 @@ const line = computed(() => {
561568
562569 function useTooltip (index ) {
563570 selectedDatapoint .value = index;
571+ commonSelectedIndex .value = index;
564572 const mappedSeries = ds .map (d => {
565573 return {
566574 ... d,
@@ -743,6 +751,7 @@ const bar = computed(() => {
743751
744752 function useTooltip (index ) {
745753 selectedDatapoint .value = index;
754+ commonSelectedIndex .value = index;
746755
747756 const mappedSeries = ds .map (d => {
748757 return {
@@ -802,6 +811,7 @@ const bar = computed(() => {
802811 function killTooltip () {
803812 isTooltip .value = false ;
804813 selectedDatapoint .value = null ;
814+ commonSelectedIndex .value = null ;
805815 }
806816
807817 return {
@@ -1217,7 +1227,7 @@ defineExpose({
12171227 :y =" line.drawingArea.top"
12181228 :height =" line.drawingArea.height <= 0 ? 0.00001 : line.drawingArea.height"
12191229 :width =" line.slotSize <= 0 ? 0.00001 : line.slotSize"
1220- :fill =" selectedDatapoint === i ? FINAL_CONFIG.xyHighlighterColor : 'transparent'"
1230+ :fill =" [ selectedDatapoint, commonSelectedIndex].includes(i) ? FINAL_CONFIG.xyHighlighterColor : 'transparent'"
12211231 :style =" `opacity:${FINAL_CONFIG.xyHighlighterOpacity}`"
12221232 @mouseenter =" line.useTooltip(i)"
12231233 @mouseleave =" line.killTooltip()"
@@ -1396,7 +1406,7 @@ defineExpose({
13961406 :y =" bar.drawingArea.top"
13971407 :height =" bar.drawingArea.height <= 0 ? 0.00001 : bar.drawingArea.height"
13981408 :width =" bar.slotSize <= 0 ? 0.00001 : bar.slotSize"
1399- :fill =" selectedDatapoint === i ? FINAL_CONFIG.xyHighlighterColor : 'transparent'"
1409+ :fill =" [ selectedDatapoint, commonSelectedIndex].includes(i) ? FINAL_CONFIG.xyHighlighterColor : 'transparent'"
14001410 :style =" `opacity:${FINAL_CONFIG.xyHighlighterOpacity}`"
14011411 @mouseenter =" bar.useTooltip(i)"
14021412 @mouseleave =" bar.killTooltip()"
@@ -1504,9 +1514,12 @@ defineExpose({
15041514 :minimapSelectionRadius =" FINAL_CONFIG.zoomMinimap.selectionRadius"
15051515 :minimapLineColor =" FINAL_CONFIG.zoomMinimap.lineColor"
15061516 :minimap =" minimap"
1517+ :minimapIndicatorColor =" FINAL_CONFIG.zoomMinimap.indicatorColor"
1518+ :minimapSelectedIndex =" commonSelectedIndex"
15071519 v-model:start =" slicer.start"
15081520 v-model:end =" slicer.end"
15091521 @reset =" refreshSlicer"
1522+ @trapMouse =" setCommonSelectedIndex"
15101523 >
15111524 <template #reset-action =" { reset } " >
15121525 <slot name =" reset-action" v-bind =" { reset }" />
0 commit comments