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

Missing final X-axis tick label with Datetime #4832

Open
tharmaman opened this issue Nov 27, 2024 · 2 comments
Open

Missing final X-axis tick label with Datetime #4832

tharmaman opened this issue Nov 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tharmaman
Copy link

tharmaman commented Nov 27, 2024

Description

When using a datetime xaxis with an xaxis label formatter, the final tick gets rendered but NOT the final tick label.

This issue appears on "Column", "Line" and "Mixed Column Line" charts.

While debugging the x axis formatter, I noticed the final tick value does get passed, it just never gets rendered. I left a console log in the x axis formatter function attached to the codepen link below, the 2024 value gets logged but is never rendered.

Screenshots

apexcharts_mising-x-label-line apexcharts_mising-x-label-column

Steps to Reproduce

  1. Use anxaxis of type: 'datetime
  2. Add an xaxis label formatter function through xaxis.labels.formatter

Expected Behavior

All xaxis ticks should have an xaxis tick label.

Actual Behavior

The final xaxis tick is missing an xaxis tick label.

Reproduction Link

https://codepen.io/LoopBoi/pen/raBNZpx

@tharmaman tharmaman added the bug Something isn't working label Nov 27, 2024
@Kalavida
Copy link

Kalavida commented Jan 7, 2025

It looks like no one's taken a look into it so I'm taking this up

@ris-tlp
Copy link

ris-tlp commented Jan 13, 2025

Seems to be similar to #1053, and it looks like the last label is skipped if there's not enough space to draw it according to the author.

The workaround provided by atuljha23 works for me in the mean time, might help you as well. Just play around with the padding until the last tick label is visible, hope it helps!

just add the padding properties to your x-axis

something like

 grid: {
      padding: {
        right: 25,
      },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants