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

[BUG] Formatter "opts" does not appear to work #74

Open
daveomcd opened this issue Aug 1, 2021 · 0 comments
Open

[BUG] Formatter "opts" does not appear to work #74

daveomcd opened this issue Aug 1, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@daveomcd
Copy link

daveomcd commented Aug 1, 2021

I am wanting to display a value on my data labels that is different from the charted data. So I made a collection that matches the x-axis labels that I wanted to pull from given the index value.

I found this documentation here for the "formatter": Apex Charts Data Labels Documentation

Discussed there is an "opts" parameter that seems to be what I want. However, I am getting an error when I attempt to use it. Is this not supported? Or am I doing something incorrectly?

I'm on Rails 5.1.6. Relevant gems installed: apexcharts, functionable-json

dataLabels: { 
    enabled: false, 
    formatter: function(val,opts) { return ((val == null) ? '' : '$ ') + parseFloat(val).toLocaleString().substring(0,parseFloat(val).toLocaleString().length-4); } 
  },

Error:
undefined local variable or method `opts' for #<#Class:0x00007faab8427b50:0x00007faaa9cfb588>

@daveomcd daveomcd added the bug Something isn't working label Aug 1, 2021
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