apexcharts.js icon indicating copy to clipboard operation
apexcharts.js copied to clipboard

YAxis labels not shown when formatted starts with 0

Open sergeydus opened this issue 1 year ago • 2 comments

Description

If the formatter you pass into the yaxis.labels.format function formats text that starts with zero, it'll appear empty

Steps to Reproduce

  1. create a chart with a series
  2. set yaxis.labels.formatter to ()=>'0 test'
  3. on hover labels no longer appear

Expected Behavior

hover labels should appear

Actual Behavior

hover labels do not appear

Screenshots

image

Reproduction Link

https://codepen.io/sergeydus/pen/MWxJLOQ

sergeydus avatar Jan 16 '24 10:01 sergeydus

I'm seeing this issue as well. If it's a float number starting with 0 it is working. But not if you want to format it with a comma instead of a dot.

  • ()=>'0.25 test' is working
  • ()=>'0,25 test' is not working

The same also applies when using tooltip.y.formatter function

olgad0110 avatar Feb 07 '24 13:02 olgad0110

As a workaround for now, also set the tooltip.y.formatter when setting y-axis formatter.

      tooltip: {
          y: {
            formatter: (val) => {
              return val
            }
          }
        }

junedchhipa avatar Feb 13 '24 17:02 junedchhipa

As a workaround for now, also set the tooltip.y.formatter when setting y-axis formatter. This workaround doesn't work for me when val equals zero. Have to use: if (val === 0) return '"0"'

XamzatJR avatar Feb 22 '24 18:02 XamzatJR

This issue is no longer present. It was fixed with the latest releases. Try upgrading apexcharts to 3.49.0

junedchhipa avatar May 07 '24 11:05 junedchhipa