Skip to content

Last date label hidden on Time Series X-axis #39899

Closed

Description

@aijung0331

Bug description

In Charts, when the X-axis is set to a Time format, the last date label often fails to display.
This is particularly important for daily or hourly monitoring dashboards where the user needs to confirm the exact "latest" time reflected on the chart at a glance.

Image

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

I don't know

Node version

I don't know

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Activity

  1. dosubot commented on May 6, 2026

    @dosubot

    This is a known and actively-discussed issue. You actually raised this same topic in Discussion #39361, where it was explored in detail [1].

    Root cause: ECharts' hideOverlap: true setting aggressively suppresses the last label when it detects potential overlap at the axis boundary. Despite several fixes merged in early 2026 (PR #37755, PR #38733, PR #38979), there's a discrepancy between those PRs and the current codebase — showMaxLabel does not appear to be set in the current transformProps.ts [2]. The showMaxLabel approach has a troubled history: it was added, reverted (PR #24995) due to "phantom labels," and subsequent fixes evolved away from it.

    Current state: There is no deterministic user-facing configuration that guarantees the last time label is always shown [1]. The available workarounds are:

    1. Apply non-zero X-axis label rotation (e.g., 45°) — triggers hideOverlap: false in newer builds
    2. Increase chart width to reduce overlap detection
    3. Theme-level override (Superset 6.0+) — use echartsOptionsOverridesByChartType to inject showMaxLabel: true globally if you control the deployment
    4. Cast date column to STRING at the dataset level and set "X Axis Label Interval → All" to bypass time-scale overlap logic entirely

    For your monitoring dashboard use case where the latest timestamp must always be visible, a feature request for an exposed showMaxLabel toggle or a dedicated "Always show last label" control would be well-motivated. The infrastructure partially exists — extending the ECharts Options JS editor (currently available for Evolution chart types) to Time-Series charts would also address this.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about superset Share Dosu with your team

  2. Cloud-Architect-Emma commented on May 6, 2026

    @Cloud-Architect-Emma
    Contributor

    Hi @aijung0331 , thanks for raising the issue, i'd like to help fix this issue . Can you assign it to me ?

  3. bikash-barnwal commented on Aug 14, 2026

    @bikash-barnwal
    Contributor

    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):

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions