@@ -291,6 +291,12 @@ function segregateDonut(arc, ds) {
291
291
}
292
292
}
293
293
294
+ const commonSelectedIndex = ref (null );
295
+
296
+ function setCommonSelectedIndex (index ) {
297
+ commonSelectedIndex .value = index;
298
+ }
299
+
294
300
const donut = computed (() => {
295
301
if (chartType .value !== detector .chartType .DONUT ) return null ;
296
302
const ds = formattedDataset .value .dataset .map ((ds , i ) => {
@@ -373,6 +379,7 @@ const donut = computed(() => {
373
379
function killTooltip () {
374
380
isTooltip .value = false ;
375
381
selectedDatapoint .value = null ;
382
+ commonSelectedIndex .value = null ;
376
383
}
377
384
378
385
const drawingArea = {
@@ -561,6 +568,7 @@ const line = computed(() => {
561
568
562
569
function useTooltip (index ) {
563
570
selectedDatapoint .value = index;
571
+ commonSelectedIndex .value = index;
564
572
const mappedSeries = ds .map (d => {
565
573
return {
566
574
... d,
@@ -743,6 +751,7 @@ const bar = computed(() => {
743
751
744
752
function useTooltip (index ) {
745
753
selectedDatapoint .value = index;
754
+ commonSelectedIndex .value = index;
746
755
747
756
const mappedSeries = ds .map (d => {
748
757
return {
@@ -802,6 +811,7 @@ const bar = computed(() => {
802
811
function killTooltip () {
803
812
isTooltip .value = false ;
804
813
selectedDatapoint .value = null ;
814
+ commonSelectedIndex .value = null ;
805
815
}
806
816
807
817
return {
@@ -1217,7 +1227,7 @@ defineExpose({
1217
1227
:y =" line.drawingArea.top"
1218
1228
:height =" line.drawingArea.height <= 0 ? 0.00001 : line.drawingArea.height"
1219
1229
: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'"
1221
1231
:style =" `opacity:${FINAL_CONFIG.xyHighlighterOpacity}`"
1222
1232
@mouseenter =" line.useTooltip(i)"
1223
1233
@mouseleave =" line.killTooltip()"
@@ -1396,7 +1406,7 @@ defineExpose({
1396
1406
:y =" bar.drawingArea.top"
1397
1407
:height =" bar.drawingArea.height <= 0 ? 0.00001 : bar.drawingArea.height"
1398
1408
: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'"
1400
1410
:style =" `opacity:${FINAL_CONFIG.xyHighlighterOpacity}`"
1401
1411
@mouseenter =" bar.useTooltip(i)"
1402
1412
@mouseleave =" bar.killTooltip()"
@@ -1504,9 +1514,12 @@ defineExpose({
1504
1514
:minimapSelectionRadius =" FINAL_CONFIG.zoomMinimap.selectionRadius"
1505
1515
:minimapLineColor =" FINAL_CONFIG.zoomMinimap.lineColor"
1506
1516
:minimap =" minimap"
1517
+ :minimapIndicatorColor =" FINAL_CONFIG.zoomMinimap.indicatorColor"
1518
+ :minimapSelectedIndex =" commonSelectedIndex"
1507
1519
v-model:start =" slicer.start"
1508
1520
v-model:end =" slicer.end"
1509
1521
@reset =" refreshSlicer"
1522
+ @trapMouse =" setCommonSelectedIndex"
1510
1523
>
1511
1524
<template #reset-action =" { reset } " >
1512
1525
<slot name =" reset-action" v-bind =" { reset }" />
0 commit comments