Skip to content

Conversation

@developerzohaib786
Copy link

@developerzohaib786 developerzohaib786 commented Nov 12, 2025

Summary

Fixes #33905

  • File Updated: plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
  • Change Description:
    Updated logic to set axisLabel.hideOverlap based on the axis type:
    • Time axes: hideOverlap = false (always show final labels)
    • Categorical/Value axes: hideOverlap = true (suppress overlapping labels)

Regression Coverage

  • Test File: plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
  • New Tests Added:
    • Assert that hideOverlap is false for time-based axes.
    • Assert that hideOverlap is true when the x-axis is forced to be categorical.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Nov 12, 2025

Code Review Agent Run #3e36a9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: a5150af..a5150af
    • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the viz:charts:timeseries Related to Timeseries label Nov 12, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Time axis label overlap not prevented ▹ view
Performance Unnecessary computation in hideOverlap property ▹ view
Files scanned
File Path Reviewed
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

nameLocation: 'middle',
axisLabel: {
hideOverlap: true,
hideOverlap: xAxisType !== AxisType.Time,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time axis label overlap not prevented category Functionality

Tell me more
What is the issue?

The conditional logic for hideOverlap may cause label overlap issues for time-based charts where labels could still overlap despite being disabled.

Why this matters

When xAxisType is AxisType.Time, hideOverlap will be set to false, which means overlapping labels will be displayed. This could result in unreadable or cluttered time axis labels, especially when there are many data points or long time labels that naturally overlap.

Suggested change ∙ Feature Preview

Consider the specific use case requirements. If time labels should never overlap, keep hideOverlap: true for all axis types. If time labels need to show all values even when overlapping, consider adding additional logic to handle label formatting or rotation:

hideOverlap: xAxisType !== AxisType.Time ? true : shouldShowAllTimeLabels,

Or implement proper label spacing/rotation for time axes to prevent overlap while showing all labels.

Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

nameLocation: 'middle',
axisLabel: {
hideOverlap: true,
hideOverlap: xAxisType !== AxisType.Time,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary computation in hideOverlap property category Performance

Tell me more
What is the issue?

The hideOverlap property is being computed on every render by comparing xAxisType to AxisType.Time, which is an unnecessary computation since these values don't change during the component lifecycle.

Why this matters

This creates a minor performance overhead as the comparison is executed on every function call, even though the result will be the same for a given xAxisType value throughout the component's lifecycle.

Suggested change ∙ Feature Preview

Pre-compute the boolean value and store it in a variable before the xAxis object definition:

const shouldHideOverlap = xAxisType !== AxisType.Time;

let xAxis: any = {
  type: xAxisType,
  name: xAxisTitle,
  nameGap: convertInteger(xAxisTitleMargin),
  nameLocation: 'middle',
  axisLabel: {
    hideOverlap: shouldHideOverlap,
    formatter: xAxisFormatter,
    rotate: xAxisLabelRotation,
    interval: xAxisLabelInterval,
  },
  // ... rest of config
};
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

@sadpandajoe sadpandajoe changed the title fixed Last Month Label Missing on X-Axis in Time Series Line Charts fix: Last Month Label Missing on X-Axis in Time Series Line Charts Nov 13, 2025
Copilot finished reviewing on behalf of sadpandajoe November 13, 2025 18:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the last month label was missing on the X-axis in time series line charts. The fix conditionally sets the hideOverlap property based on axis type: false for time-based axes (to ensure all labels including the last one are displayed) and true for categorical/value axes (to prevent overlapping labels).

Key Changes:

  • Modified hideOverlap logic in transformProps.ts to be conditional based on axis type
  • Added test coverage for both time-based and categorical x-axis scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts Updated hideOverlap property to be false for time axes and true for other axis types
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts Added two test cases to verify hideOverlap behavior for time-based and categorical axes

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Last month doesn't appear on X axis for Time Series Line Chart

1 participant