Google chart colors disappeared on live project but works good in offline

14 views
Skip to first unread message

Dasarathan Sampath

unread,
Jun 5, 2019, 4:29:49 AM6/5/19
to Google Visualization API

2.PNGCapture.PNG

can any one please help me with below issue?


After uploading local laravel project to godaddy website, the chart colors are disappeared.

I created a google pie chart in laravel and it works well. I have uploaded my project to live. But in live the google pie chart is not loading


Attached image: The chart is completely grayed out with single color (in live & after upload) second image is from local project with color and data.


Below is my script code:


  <!-- Google maps -->
        <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
            var analytics1 = <?php echo $alliance; ?>;
            google.charts.load('current', {'packages':['corechart']});
            google.charts.setOnLoadCallback(drawChart1);
            /* call pie chart1*/
            function drawChart1()
            {
            var data1 = google.visualization.arrayToDataTable(analytics1);
            var options1 = {
                title:'2014 National Alliance data',
                chartArea:{right:0,top:0,width:"120%",height:"120%"},
                pieHole:0.4,
                legend: { position: 'top', alignment: 'start' },
                };
            var chart1 = new google.visualization.PieChart(document.getElementById('chart_div1'));
            chart1.draw(data1, options1);
            }
</script>
Reply all
Reply to author
Forward
0 new messages