0

I'm trying to acces a variable inside load callback function. I only have acces to this, and event parameters. Is it possible to set a new property to Highcharts object to acces it via this?

This is what I'm trying to do:

  chart: {
    events: {
      load: function() {
        myBoolean ? console.log("HERE") : console.log("THERE");
      }
    }
  },
Bernardo Marques
  • 925
  • 2
  • 10
  • 33
  • 1
    Hi @Bernardo Marques, In your example you have an access to the `myBoolean` variable. What do exactly you want to achieve? – ppotaczek Jul 16 '20 at 12:13
  • Interesting, In my case I have a function call for the highcharts constructor on other file, I think that´s why I don't have acces to it on that other file. Maybe I need to initialize a new variable inside the callback that gets this outer value. This way when highcharts generates the object to initialize it it will load this callback and have the boolean. – Bernardo Marques Jul 16 '20 at 12:41
  • 1
    I have handled it using the boolean outside of callback, generating different callbacks depending on the boolean, but I'll try this new approach and update here. – Bernardo Marques Jul 16 '20 at 12:43

0 Answers0