<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// Load the Visualization API and the corechart package.
google.charts.load('current', { 'packages': ['corechart'] });

// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {

    for (var j = 0; j &lt; totalaudince.length; j++) {
        var data = new google.visualization.DataTable();
        data.addColumn('string', '');

        for (var i = 1; i &lt;= totaloption; i++) {
            data.addColumn('number', 'Option ' + optionchar[i - 1]);
        }
        data.addRows(totalaudince[j].alist.length);

        for (var k = 0; k &lt; totalaudince[j].alist.length; k++) {
            data.setCell(k, 0, totalaudince[j].alist[k].itemName);

            for (var r = 1; r &lt;= totaloption; r++) {
                if (type == "2") {
                    data.setCell(k, r, totalaudince[j].alist[k].totalcount[r - 1].totaloptioncount);
                }
                else {
                    data.setCell(k, r, totalaudince[j].alist[k].totalitem);
                }
            }
        }

        var options_fullStacked = {
            isStacked: 'percent',
            legend: { position: 'top', maxLines: 3 },
            hAxis: {
                minValue: 0,
                ticks: [0, 1]
            }
        };

        var chart = new google.visualization.BarChart(document.getElementById('chart_div_' + j));
        chart.draw(data, options_fullStacked);
    }


    //var data1 = google.visualization.arrayToDataTable([
    //    ['Age', 'A', 'B', 'C'],
    //    ['&lt;17', 12, 19, 20],
    //    ['18-24', 12, 22, 25],
    //    ['25-34', 12, 11, 25],
    //    ['35-44', 12, 19, 25]
    //]);

    //// Set chart options
    //var options_fullStacked = {
    //    isStacked: 'percent',
    //    legend: { position: 'top', maxLines: 3 },
    //    hAxis: {
    //        minValue: 0,
    //        ticks: [0, 1]
    //    }
    //};



    // Instantiate and draw our chart, passing in some options.
    //var chart = new google.visualization.BarChart(document.getElementById('chart_div_0'));
    //chart.draw(data, options_fullStacked);

    // //Instantiate and draw our chart, passing in some options.
    //var chart1 = new google.visualization.BarChart(document.getElementById('chart_div_1'));
    //chart1.draw(data1, options_fullStacked);
}
</pre></body></html>