Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 139863

auto refresh google chart

$
0
0

i have a pie chart and want to auto refresh my pie chart every 5 sec this is my script code and thank you hey guys , i have a pie chart and want to auto refresh my pie chart every 5 sec this is my script code and thank you

<script type="text/javascript">
    google.load("visualization", "1", { packages: ["corechart"] });
    google.setOnLoadCallback(drawChart);
    function drawChart() {
        var options = {
            width: 900,
            height: 500,
            title: 'Partition des tickets',
            legend: 'left',
            is3D: true,


        };
        $.ajax({
            type: "POST",
            url: "Home.aspx/GetPieChartData",
            data: '{}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (r) {
                var data = google.visualization.arrayToDataTable(r.d);
                var chart = new google.visualization.PieChart($("#chart_Pie")[0]);
                chart.draw(data, options);
            },
            failure: function (r) {
                alert(r.d);
            },
            error: function (r) {
                alert(r.d);
            }
        });
    }
</script>  

Viewing all articles
Browse latest Browse all 139863

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>