Repository navigation
Description
Description
The chart widget currently has hovermode hardcoded to 'x unified' in the toPlotly function (WidgetChart.jsx).
This causes Plotly to always display the X axis value (absolute time) as the header of the unified tooltip,
regardless of what is defined in the hovertemplate of each trace.
Additionally, PR #12413 introduced a workaround (hoverOnlyOnTickValues / handleBeforeHover /
getHoverOnlyOnTickValuesAxisOptions) to limit tooltip visibility to tick positions only.
This workaround does not match the original requirement and should be removed as part of this fix.
Requirement
The original needing was:
"An option to allow configuring the chart tooltip to exclude the X axis label,
so users can see the Y value without the absolute time indication."
Proposed Fix
1. Remove the tick-based tooltip workaround from #12413
Remove the following logic from WidgetChart.jsx:
getHoverOnlyOnTickValuesAxisOptionsgetHoverAxis/getHoverPixel/isHoverOnAxisTickValues/isHoverOnTickValueshoverOnlyOnTickValuesAxisOptionsmemohandleBeforeHovercallback and itsonBeforeHoverprop
Also remove the related configuration option (showHoverOnlyOnTickValues) from the axis options
and from the widget creation wizard.
2. Make hovermode configurable in the Layout tab
Add a new dropdown option in the Layout tab of the widget creation wizard to control the chart hovermode.
The available options should be:
- Unified X tooltip (
x unified) — shows a single tooltip for all traces at the same x position, including the x axis value as header. (default) - Unified Y tooltip (
y unified) — shows a single tooltip for all traces at the same y position, including the y axis value as header. - X tooltip (
x) — shows individual tooltips for all traces at the same x position, including the x axis value. - Y tooltip (
y) — shows individual tooltips for all traces at the same y position, including the y axis value. - Individual tooltip (
closest) — shows a tooltip only for the closest data point, without the axis value. - No tooltip (
false) — disables the tooltip entirely.
Describe the mode in a tooltip.
Acceptance Criteria
- A new dropdown in the Layout tab allows the user to select the chart
hovermode - The following options are available:
x unified(default),y unified,x,y,closest,false - The selected
hovermodeis correctly passed to the Plotly layout:
hovermode: layout?.hovermode ?? 'x unified' - When
closestis selected, only the Y value is shown in the tooltip (no absolute time), consistently across all trace types and screen sizes - When
falseis selected, no tooltip is shown - The setting is correctly persisted in and restored from the widget configuration
Activity
Replace "show only tick values" with hide value in tooltip" option #1…
Replace "show only tick values" with hide value in tooltip" option #1…
[-]Replace "show only tick values" with hide value in tooltip" option[/-][+]Replace "show only tick values" with "Tooltip mode"[/+]Replace "show only tick values" with hide value in tooltip" option #1…
Update to upstream v2026.01.02 (#77)