sgratzl / chartjs-chart-boxplot

Chart.js Box Plots and Violin Plot Charts
https://www.sgratzl.com/chartjs-chart-boxplot/
MIT License
101 stars 23 forks source link

hoveredOutlierIndex returns -1 every time #17

Closed SorataYuu closed 2 years ago

SorataYuu commented 2 years ago

When I have a box plot, and mouse over an outlier. The tooltip context returns hoveredOutlierIndex as -1 despite being hovered over an outlier.

I tried to access it using this.

chart_config.options.interaction = {
            mode: 'index'
        };

        chart_config.options.plugins.tooltip.callbacks.footer = (tooltip_items) => {
            console.log(tooltip_items);
        }
sgratzl commented 2 years ago

can you provide a sample codepen, please

SorataYuu commented 2 years ago

I've made a codepen that prints the hoveredOutlierIndex on the tooltip: https://codepen.io/soratayuu/pen/MWOrNxw

sgratzl commented 2 years ago

take a look at https://codepen.io/sgratzl/pen/bGYLqWK?editors=0010

I just released v3.7.0 which adapt for chart.js 3.7

SorataYuu commented 2 years ago

It works great! Thank you! Really appreciate it!