fix(explore): show the beginning date on time-series x-axis line charts (#42046)

This commit is contained in:
jesperct
2026-07-23 21:14:30 -03:00
committed by GitHub
parent 206fe7ab12
commit c43effa4a3
4 changed files with 163 additions and 3 deletions

View File

@@ -641,7 +641,22 @@ export default function transformProps(
const deduplicatedFormatter = showMaxLabel
? (() => {
let lastLabel: string | undefined;
let lastValue: number | undefined;
const wrapper = (value: number | string) => {
// ECharts formats the labels in repeated ascending passes. Reset the
// dedup state when the sequence restarts so a forced boundary label
// (e.g. the min date) isn't blanked by the previous pass's last label
// when both format identically (e.g. a May-to-May range).
if (
typeof value === 'number' &&
lastValue !== undefined &&
value <= lastValue
) {
lastLabel = undefined;
}
if (typeof value === 'number') {
lastValue = value;
}
const label =
typeof xAxisFormatter === 'function'
? (xAxisFormatter as Function)(value)
@@ -743,6 +758,8 @@ export default function transformProps(
...(showMaxLabel && {
showMaxLabel: true,
alignMaxLabel: 'right',
showMinLabel: true,
alignMinLabel: 'left',
}),
},
minorTick: { show: minorTicks },