Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option yaxis.labels.formatter is not updated when options prop changes #4400

Closed
leonbloy opened this issue Apr 12, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@leonbloy
Copy link

leonbloy commented Apr 12, 2024

Description

I want the yaxis.labels.formatter to be changed upon some condition. I build a new options object in that case
(with useMemo()) and pass it to the same Chart

However, the formatter sometimes doesn't change - or changes only the first time.

https://codesandbox.io/p/sandbox/apexcharts-issue-vdt3jp

Steps to Reproduce

  1. Go to https://codesandbox.io/p/sandbox/apexcharts-issue-vdt3jp
  2. Click repeteadly the "toggle" button

Expected Behavior

The format (both in the y axis and in the data points tooltips) should alternate between "$ 000" and "n =000"

Actual Behavior

Only the first time the format changes.

The behaviour is not fully predictable. Sometimes by just adding a change in the legend (SHOWLEGEND=true) or adding
a (changing) title, the new format applies.

Screenshots

Issue2024-04-11.231426.mp4

Reproduction Link

https://codesandbox.io/p/sandbox/apexcharts-issue-vdt3jp

@leonbloy leonbloy added the bug Something isn't working label Apr 12, 2024
@leonbloy leonbloy changed the title Option ( yaxis.labels.formatter ) is not updated when options prop changes Option yaxis.labels.formatter is not updated when options prop changes Apr 12, 2024
@leonbloy
Copy link
Author

leonbloy commented Apr 12, 2024

If I add to the options object a title that changes, like

title: { text: `countmode=${countMode}` }

the problem seems to disappear

@leonbloy
Copy link
Author

update: I see that the problem is caused by this issue
apexcharts/react-apexcharts#144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant