[Vuejs]-Append API data into an array

0๐Ÿ‘

โœ…

You can use updateSeries method or you can directly update the value of series. Please check below code

Code Snippet

generateDayWiseTimeSeries: function() {
    var me = this;
    axios.get("data.json")
        .then(function(res) {
            me.series[0].data = res.data;
            //OR you can use updateSeries method

            /* me.$children[0].updateSeries([{
               data: res.data
             }]);*/
        });

    return [];
}

You can check here with working fiddle.

0๐Ÿ‘

generateDayWiseTimeSeries function return undefined variable => series.

Assign returned data to series instead of self.series.

Leave a comment