Skip to content

When zooming in the x-axis, a shared tooltip displays incorrect data #3439

@lunarkbot

Description

@lunarkbot

Description

If on the Column Chart we use tooltips with the "shared" property turned on and apply the zoomX method to the chart, in which the first parameter is any value along the X axis higher than 1. Then, when we hover over the first column, we will see incorrect data in the tooltip: Data from the very first column of the graph will always be displayed, regardless of which column is actually the first after zooming.

Steps to Reproduce

  1. As a basis, I took an example from the official Apexchart website.
  2. We need to change the chart properties for the zoom and shared tooltips to work.
    Let's add some properties.
chart: {
      type: 'bar',
      height: 350,
      width: 350, // added
},
xaxis: {
      type: 'category', // added
      categories: ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
      tickPlacement: 'on', // added
      tickAmount: 9, // added
},
tooltip: { // added
      enabled: true,
      intersect: false,
      shared: true,
},
  1. Let's apply the zoomX method to the chart.
chart.zoomX(4, 8)
  1. Now hover your mouse over the first column of the chart to see the tooltip with incorrect data.

Expected Behavior

When hovering over the first column after zooming, display in the tooltip the data corresponding to the selected chart column.

Actual Behavior

When hovering over the first column of the chart after zooming, the tooltip always displays the data of the very first column of the chart.

Screenshots

image

apexchart

Reproduction Link

https://codepen.io/lunarkbot/pen/zYjVPYa

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions