You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a custom formatter function for the xaxis, the tooltip also displays the same formatted labels instead of the default values. This results in a situation where if you use a custom truncating function for the x-axis, the tooltip labels also show truncated text.
The behaviour can be fixed by defining a formatter function for the tooltip as well. But this results in an arguably needless definition like: x: {formatter: function (val:string) {return val;}}.
I propose that this behaviour should be documented in the docs for the tooltip as already done for the y-axis: By default, these values will be formatted according [yaxis.labels.formatter](https://apexcharts.com/docs/options/yaxis/#formatter) function which will be overrided by this function if you define it.
Ideally, a similar notice should also be shown in the docs for xaxis and yaxis. Something like: "Setting a custom formatting function will change the tooltip text. Set the formatting function under tooltip.x/tooltip.y to override this behaviour."
Steps to Reproduce
Create a line/bar chart with some data.
Set a custom formatter function for the xaxis > labels.
See that your custom formatting is displayed for both the x-axis labels and for tooltips.
Expected Behavior
Ideally, the tooltip label's formatting should be independent of the x-axis labels. In this case, the tooltip should display whatever the default x-axis labels are and not the formatted labels. Or the behaviour should be documented in the docs.
Actual Behavior
The tooltip displays formatted x-axis labels by default instead of showing the default values or the categories defined under xaxis.
Description
When using a custom formatter function for the
xaxis
, thetooltip
also displays the same formatted labels instead of the default values. This results in a situation where if you use a custom truncating function for the x-axis, the tooltip labels also show truncated text.The behaviour can be fixed by defining a formatter function for the tooltip as well. But this results in an arguably needless definition like:
x: {formatter: function (val:string) {return val;}}
.I propose that this behaviour should be documented in the docs for the tooltip as already done for the y-axis:
By default, these values will be formatted according [yaxis.labels.formatter](https://apexcharts.com/docs/options/yaxis/#formatter) function which will be overrided by this function if you define it.
Ideally, a similar notice should also be shown in the docs for
xaxis
andyaxis
. Something like: "Setting a custom formatting function will change the tooltip text. Set the formatting function undertooltip.x
/tooltip.y
to override this behaviour."Steps to Reproduce
xaxis > labels
.Expected Behavior
Ideally, the tooltip label's formatting should be independent of the x-axis labels. In this case, the tooltip should display whatever the default x-axis labels are and not the formatted labels. Or the behaviour should be documented in the docs.
Actual Behavior
The tooltip displays formatted x-axis labels by default instead of showing the default values or the
categories
defined underxaxis
.Reproduction Link
https://codepen.io/buzodog/pen/KKOzqJE
The text was updated successfully, but these errors were encountered: