apexcharts / apexcharts.js

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

Incorrect display format for horizontal bar charts when using formatter functions #4472

Open fabio-sp opened 1 month ago

fabio-sp commented 1 month ago

Description

When displaying an horizontal bar chart, x axis format is not correctly shown on the tooltip. The values displayed on the axis itself are correctly formatted using the x-axis formatter function, but the values shown in the tooltip are formatted using the y-axis formatter (if provided).

I'm willing to triage this issue but since I'm not familiar with the codebase some guidance could be helpful.

Steps to Reproduce

  1. Create a chart with chart type 'bar' and plotOptions.bar.horizontal 'true';
  2. Apply a fomatter function on both axes;
  3. Render the chart;

Expected Behavior

Actual Behavior

Screenshots

image

Reproduction Link

https://codepen.io/FabioSpa/pen/QWRjvMY

Cactii1 commented 2 weeks ago

This bug must be related to what I am experiencing. I can't get a logarithmic scale to display properly because the bars end up being the wrong length. It really makes log scale unusable for this type of chart.