[Vuejs]-Error: Data source must be a URL for refresh | console error | javascript | Highcharts

1👍

Please remove refresh attribute in your code.

<column-chart :min="0" height="400px" xtitle="City" 
 :data="series" label="Value"></column-chart>

Console error will not show. If you remove the refresh option. refresh should be from your url. Not from chart.

0👍

<line-chart :data="charturl" :refresh="30"></line-chart>  

<script type="text/javascript">
   var app = new Vue({
            el: '#app',
            data: {
                charturl: 'your_url.php'
            }
   });
</script>

in your_url.php

    $arr  =  Array(
        '1' => '13',
        '2' => '15',
        '3' => '4',
        '4' => '4',
        '5' => '40',
        '6' => '6',
        '7' => '4',
        '8' => '10',
    );

    return json_encode($arr);

And every 30 seconds a request will be sent. If $arr change, then chart line changed.

👤Sav4yk

Leave a comment