formatter callback function, how to do it?
See original GitHub issueBased on my limited experience, it looks like most of work for create a highchart is about specifying the config
object (which by itself is pretty powerful). But I haven’t figured out a way to write formatter callback function. Obviously I can’t access the chart data with this.y
. What would be the right way to define my own formatter function?
Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Formatter Callback Functions - Philipp Salvisberg's Blog
An Arbori query can return multiple columns and multiple rows. A tuple contains the columns of a single row. Therefore, a callback function...
Read more >Format tooltip with custom callback function formatter
The following code shows how to format tooltip with custom callback function formatter. Example. <!DOCTYPE html> <html> ...
Read more >Setting formatter callback using highcharts-convert.js
I tried putting the formatter function outside the definition of the callback, but highcharts-convert.js won't accept that. How do I set a dataLabel ......
Read more >tooltip.formatter | highcharts API Reference
Point> A callback function for formatting the HTML output for a single point in the tooltip. Like the pointFormat string, but with more...
Read more >setFormatter() – Set Formatter Callback - PHP
Define a formatting callback function with optional arguments for this column. ... 'record' => associative array of all fields values for this record,...
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
@kirjs you’re right. All I need is to pass it as part of the config object. Actually that’s the first thing I did. However, it turned out that I mistakenly used ES6 arrow function to define formatter callback function, where
this
means differently than defining it withfunction
keyword.This was how I did it initially.
Once I change to the vanilla function definition, problem solved.
I never paid much attention to the nuance of arrow function. Now lessons learned. Closing the thread.
For anybody using TypeScript, here is the solution: