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

Column chart with datetime on x axis breaks annotation positioning on y axis #4484

Open
onetdev opened this issue May 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@onetdev
Copy link

onetdev commented May 24, 2024

Description

Annotation starts from the middle of the first column and stops at the middle of last. This doesn't seem to affect other xaxis types.

Steps to Reproduce

  1. Have a chart that uses the following configs:
var options = {
  xaxis: {
    type: "datetime",
  },
  annotations: {
    yaxis: [
      {
        y: 0,
        y2: 100,
        borderColor: "red",
        strokeDashArray: 0,
      }
    ],
  },
  ....
};

Expected Behavior

The annotation to start from the left edge of the grid and finish on the right edge

Actual Behavior

Annotation starts from the middle of the first column and stops at the middle of last.

Screenshots

The issue with datetime type

image

This is how numeric looks:

image

Reproduction Link

https://codepen.io/onetdev/pen/xxNOvZr

@onetdev onetdev added the bug Something isn't working label May 24, 2024
@junedchhipa
Copy link
Contributor

There is a difference in how the bars are drawn in a category x-axis vs datetime x-axis. Due to that difference, the position of the annotations changes based on that.

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

2 participants