Add prefix and suffix for when formatter is undefined
See original GitHub issueIs your feature request related to a problem? Please describe.
In ApexCharts.rb, the way we configure options is with ruby hash converted to JSON. We have no way to specify, e.g. formatter: function(val) { return "Rp " + val + "-" }
. Function is a valid value for JS object but not for JSON.
Describe the solution you’d like
I’d like to propose prefix
and suffix
. So, instead of specifying formatter
above, we can do this:
prefix: "Rp ",
suffix: "-",
It’s a valid key-value for JS object and JSON too. So we can specify it from ruby hash.
prefix
and suffix
should be checked only when formatter
is undefined.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How to add suffix in Google Charts callback? Formatter not ...
I can't figure out how to get a callback to work in Google Charts to include a suffix or prefix using the formatter...
Read more >Add prefix/suffix module to readme.md [#2909115] | Drupal.org
The most themable thing to do is to print prefix and suffix in separate values so they can be wrapped within html inside...
Read more >Append online a prefix or suffix to multiple lines at once
Append a prefix or suffix to lines. This online tool enables you to add text to the beginning and the end of all...
Read more >Defining a Prefix or Suffix Format for Members of Attribute ...
Defining a Prefix or Suffix Format for Members of Attribute Dimensions · Open the outline in edit mode and select the Properties tab....
Read more >accessibility.point.valuePrefix | highcharts API Reference
Prefix to add to the values in the point descriptions. Uses tooltip.valuePrefix if not defined. Defaults to undefined . valueSuffix: string.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @styd, Sorry, I have been very busy with other things lately, and this issue went unnoticed from my list. I have added additional tags to this issue to keep reminding myself to work on it soon. Thank you for your patience.
How about this approach?
This will require a minimal change in apexcharts lib.
Source: https://stackoverflow.com/questions/36517173/how-to-store-a-javascript-function-in-json#answer-47558227