apexcharts.js
apexcharts.js copied to clipboard
YAxis labels not shown when formatted starts with 0
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
- create a chart with a series
- set yaxis.labels.formatter to ()=>'0 test'
- on hover labels no longer appear
Expected Behavior
hover labels should appear
Actual Behavior
hover labels do not appear
Screenshots
Reproduction Link
https://codepen.io/sergeydus/pen/MWxJLOQ
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
As a workaround for now, also set the tooltip.y.formatter
when setting y-axis formatter.
tooltip: {
y: {
formatter: (val) => {
return val
}
}
}
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"'
This issue is no longer present. It was fixed with the latest releases. Try upgrading apexcharts to 3.49.0