Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Keys on X-Axis with Date Format and formatTick #7041

Open
vanishree1 opened this issue Jul 2, 2024 · 0 comments
Open

Duplicate Keys on X-Axis with Date Format and formatTick #7041

vanishree1 opened this issue Jul 2, 2024 · 0 comments
Labels
bug something broken P2 needed for current cycle

Comments

@vanishree1
Copy link

When plotting a chart using Plotly with a small dataset and specifying the x-axis type as date, along with a custom formatTick function, the x-axis displays duplicate keys. This issue creates a confusing and cluttered appearance, as shown in the example provided below.

Steps to Reproduce:

Create a chart with the x-axis type set to date.
Use a small dataset with date values.
Specify a custom formatTick function for the x-axis.
Example:

You can see the issue in the following CodePen example:
CodePen Example

Expected Behavior:

The x-axis should display unique date values without any duplicates, even for small datasets, ensuring a clean and accurate representation of the data.

Actual Behavior:

The x-axis shows duplicate date values, leading to a misleading visualization.

Environment:

Plotly.js version: plotly.js-dist-min@2.32.0
Browser: chrome
Operating System: windows

This issue significantly impacts the readability of charts, especially when dealing with smaller datasets where clear and distinct x-axis labels are crucial.

Additional information:
by specifying type as category or explicitly specilfying tickvals and ticktext doesn't suit well for large dataset.
Screenshot

Screenshot 2024-07-02 210025

@gvwilson gvwilson self-assigned this Jul 12, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added bug something broken P2 needed for current cycle labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 needed for current cycle
Projects
None yet
Development

No branches or pull requests

2 participants