bikash-barnwal commented on issue #39899:
URL: https://github.com/apache/superset/issues/39899#issuecomment-5298194970
Worth flagging before someone fixes this the obvious way: the obvious fix
reopens #39972.
The x-axis currently forces the trailing label only when a time grain is set
(`Timeseries/transformProps.ts`, mirrored in `MixedTimeseries`):
```ts
const showMaxLabel =
xAxisType === AxisType.Time &&
xAxisLabelRotation === 0 &&
!!resolvedTimeGrain;
```
That `!!resolvedTimeGrain` is deliberate. #37181 added `showMaxLabel` so the
last data point's label renders; #39972 then restricted it to grained axes,
because with **Time Grain = None** ECharts' axis end is not aligned to anything
sensible, the forced label lands on a sub-minute timestamp, and `SMART_DATE`
renders it through its millisecond/second buckets — producing a phantom
`.345ms` label after the last legitimate one. There is a test pinning exactly
that (`x-axis does not force showMaxLabel when no time grain is set`).
So simply dropping the grain condition trades this bug for that one.
**Which case is in your screenshot?** If a time grain *is* set,
`showMaxLabel` is already `true` and the missing label is a different mechanism
— worth checking the dedup wrapper (it suppresses a trailing label that formats
identically to the previous tick) or plain label overflow/`interval`. If Time
Grain is **None**, then the label is being suppressed on purpose by #39972 and
the fix has to make the axis edge meaningful rather than force a label onto an
arbitrary one — e.g. clamping the axis max to the last data point, or
formatting the boundary label at the resolved data granularity instead of
letting `SMART_DATE` fall into its sub-second buckets.
Happy to implement the second approach if maintainers agree that's the right
direction; I did not want to send a PR that silently reverts a merged fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]