title: Highcharts dynamic data fetching in React
body: <p>I am trying to use <code>highcharts</code> module (highstock single line series) with React. I tried fetching the data from URL using <code>axios</code> but data is not displaying in the graph.</p>
  
  <p>Here is the snippet of my function for data passing:</p>
  
  <pre><code>series: [
      { name: 'Counts',
        data: (function() {
                axios.get('https://www.highcharts.com/samples/data/aapl-c.json')
                .then(res =&gt; {
                  console.log(res.data, 'data fetched');
                  return res.data;
                })
                .catch(err =&gt; {
                  return err;
                })
            }()),
        tooltip: {
          valueDecimals: 2
      }
      }
    ],
  </code></pre>
  
  <p>I also tried fetching data in component life cycle method '<code>componentDidMount</code>' but was unable to get the result out of method and pass it tot the data key of the series. Help Appreciated.</p>