Box charts hover only Q3, Mediana and Q1, through an invisible marker; the box itself takes no hover

This commit is contained in:
2026-12-03 17:32:41 -06:00
parent ebb8db0017
commit e93e807325
2 changed files with 16 additions and 2 deletions
+10 -1
View File
@@ -287,8 +287,17 @@ export function boxFigure(r: Reading, period: string): Figure {
upperfence: [q3],
marker: { color: '#4269C2' },
fillcolor: 'rgba(66,105,194,0.55)',
hovertemplate: `Q3: %{q3:${SHORT}}<br>Mediana: %{median:${SHORT}}<br>Q1: %{q1:${SHORT}}<extra></extra>`,
hoverinfo: 'skip',
} as Partial<Plotly.Data>,
{
type: 'scatter',
mode: 'markers',
x: [period],
y: [r.score!],
customdata: [[q3, r.score!, q1]],
marker: { size: 40, opacity: 0 },
hovertemplate: `Q3: %{customdata[0]:${SHORT}}<br>Mediana: %{customdata[1]:${SHORT}}<br>Q1: %{customdata[2]:${SHORT}}<extra></extra>`,
},
],
layout: {
showlegend: false,