0

I am facing an issue while fetching the data from "this" which actually prints a JSON object on the console. If I am going to use "this.x" then I am getting a run time error.

          formatter: function() {            
                    console.clear();
                    console.log("Point Details: ",this);
          }

the output of this console statement is:

{x: Array(1), y: 69, color: '#FFBF00', colorIndex: 0, key: 'ABCTest'}

Now if I do console like this-console.log(this.x) I am getting this error: enter image description here

Note: this code snippet is the part of Angular's Highchart tooltip formatted function.

Can anyone help me how I can access these values using "this" plus "." operator.

Himanshu
  • 71
  • 9
  • Do you use an array function in your example? It changes the scope, so it may cause this kind of issue. If not, could you please reproduce this issue in the online editor that I could work on? – magdalena Aug 11 '22 at 10:26
  • 1
    @magdalena - Using the event along with the formatter function, I am able to modify the tooltips. Thanks for all your help. – Himanshu Aug 17 '22 at 21:00

0 Answers0