question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add prefix and suffix for when formatter is undefined

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
junedchhipacommented, Oct 14, 2019

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.

1reaction
junedchhipacommented, Aug 31, 2019

How about this approach?

var fnObj = {"function":{"arguments":"a,b,c","body":"return a*b+c;"}}
var fn = new Function(fnObj.function.arguments, fnObj.function.body);

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found