Private
Public Access
1
0

Highlight table row when hovering spending chart legend items

Add legendMouseOver/legendMouseOut events to sync legend hover
with the category table highlighting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-15 19:57:54 -05:00
parent f3211b7ee7
commit 94049c08a8
@@ -347,6 +347,13 @@ const spendingChartOptions = computed(() => ({
dataPointMouseLeave: () => { dataPointMouseLeave: () => {
highlightedCategory.value = null highlightedCategory.value = null
}, },
legendMouseOver: (_ctx: any, _opts: any, config: any) => {
const labels = spending.value?.categories.map(c => c.categoryName) ?? []
highlightedCategory.value = labels[config.seriesIndex] ?? null
},
legendMouseOut: () => {
highlightedCategory.value = null
},
}, },
}, },
labels: spending.value?.categories.map(c => c.categoryName) ?? [], labels: spending.value?.categories.map(c => c.categoryName) ?? [],