Files
superset2/superset-frontend/plugins/plugin-chart-echarts/test/utils
Evan 5159ddf914 feat(echarts): respect time grain in time-series tooltips
Adopts #31765 (original by @gerbermichi), splitting the time-grain
formatting fix out from the i18n change and breaking-change concerns
raised on that PR.

Time-series and mixed time-series tooltips now honor the chart's time
grain (and any dashboard-level override delivered via extra_form_data)
when no explicit tooltip time format is set, matching the behavior the
x-axis already applies via getSmartDateFormatter. Tooltips read
grain-appropriate labels such as 'Jan 2021' (month), '2021 Q1'
(quarter), '2021' (year), and weekly date ranges. An explicit custom
tooltip format always wins.

The original PR threaded the grain through getTimeFormatter using the
SMART_DATE_VERBOSE_ID format id, which produced the literal string
'smart_date_verbose' because getTimeFormatter treats the id as a d3
format string when a granularity is supplied. This reworks the tooltip
path to use the granularity formatter (getTimeFormatter(undefined,
grain)) instead, with unit-test coverage proving the rendered output for
each grain. Adds an UPDATING.md note per villebro's request.

Co-Authored-By: Michael Gerber <michael.gerber@nxt.engineering>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 14:42:22 -07:00
..