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

Selection event x-axis min and max values are incorrect in column chart #20784

Closed
ollivihervuori opened this issue Mar 5, 2024 · 1 comment · Fixed by #20942
Closed

Selection event x-axis min and max values are incorrect in column chart #20784

ollivihervuori opened this issue Mar 5, 2024 · 1 comment · Fixed by #20942

Comments

@ollivihervuori
Copy link

ollivihervuori commented Mar 5, 2024

In the column chart, the selection event x-axis min and max values sometimes don't correspond with the selection.

The issue can be replicated with this demo: https://jsfiddle.net/otxkfrpu/

Replication steps: Make a rectangle selection (i.e., mouse button down, move mouse, and mouse button up) starting in x-axis halfway between 3 and 4 and ending to halfway between 4 and 5. In this case, the x-min is expected to be around 3.5 and x-max around 4.5.

The issue started in 11.4.0, and with the previous version (11.3.0) the behavior is correct, as shown by this demo: https://jsfiddle.net/9uL2at1z/

Issue replicated with Chrome and Firefox.

Chart settings where the issue appears:

Highcharts.chart('container', {
  "chart": {
    "zooming": {
      "type": "xy"
    },
    "events": {
      selection: evt => {
        document.getElementById("xmin").textContent = "X min: " + evt.xAxis[0].min;
        document.getElementById("xmax").textContent = "X max: " + evt.xAxis[0].max;
        return false;
      }
    }
  },
  "series": [
    {
      "type": "column",
      "data": [
        {
          "x": 3,
          "y": 1
        },
        {
          "x": 4,
          "y": 2
        },
        {
          "x": 5,
          "y": 3
        }
      ]
    }
  ]
});
@hubertkozik
Copy link
Member

Hi @ollivihervuori!

Thank you for reporting the issue. This is regression, no specific workaround for that moment.

Internal note:
Bisected to 16bbb07 FYI @TorsteinHonsi.

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

Successfully merging a pull request may close this issue.

2 participants