apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.03k stars 1.28k forks source link

Tooltip not visible in stacked column chart , when y-axis is reversed. #4509

Open Prakanksh opened 4 weeks ago

Prakanksh commented 4 weeks ago

https://github.com/apexcharts/apexcharts.js/assets/98647697/a6ab4972-8048-436c-a8e2-7d4a89a01ea2

Description

We are using column chart (stacked) having numeric values in y-axis
sometimes those values can be negative according to which we set the boolean value for y-axis in chart options "reversed" : true/ false if reversed is false the chart works fine but if reversed is true then tooltip is not visible .

Steps to Reproduce

  1. Create a column chart
  2. Have a set of series data with negative values on Y-axis
  3. Set the reversed options in y-axis to true
  4. Set Tooltip enable option to true .
  5. Check for the chart tooltip

Expected Behavior

It should show tooltip with y-axis value in the chart at the tip of the hovered bar

Actual Behavior

Tooltip is not visible until or unless tooltip is fixed (In fixing the tooltip there might be some difference between the tooltip height and hight of bars in column chart .)

Screenshots

attached a video

Reproduction Link

https://codesandbox.io/embed/cyqjy2?view=editor+%2B+preview&module=%2Fsrc%2Fcomponents%2FChart.component.vue

https://codesandbox.io/embed/cyqjy2?view=editor+%2B+preview&module=%2Fsrc%2Fcomponents%2FChart.component.vue

attaching screenshots of the code pen
pay attention to tooltip

Screenshot 2024-06-07 at 2 51 31 PM Screenshot 2024-06-07 at 2 51 22 PM
antshpra commented 4 weeks ago

Looks like ApexCharts is miscalculating the y coordinates or the tooltip when yaxis is reversed.

antshpra commented 4 weeks ago

Possibly tooltip is overshooting the chart area and hence not visible.

Prakanksh commented 4 days ago

Kindly check this issue in priority basis , as Its a major bug for a simple change in charts

antshpra commented 2 days ago

Any fix for this ?