Skip to content

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

Closed

Description

@ollivihervuori

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
        }
      ]
    }
  ]
});

Activity

  1. hubertkozik commented on Mar 6, 2024

    @hubertkozik
    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.

  2. self-assigned this
    on Apr 2, 2024
  3. added a commit that references this issue on Apr 3, 2024
    ca511ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions