Please help me, im beginner in xsl and i want to convert/transfer the 
google chart script into xsl? I have already converted google chart into 
xsl but (e.g line chart, column chart) to produce html file but the script 
that i want is too complicated for me to convert. Help me please. Thank you.

Here's the script (Proportional Column Google Chart):


    function drawVisualization() {

    var data = google.visualization.arrayToDataTable([
    ['Year', 'Austria', 'Belgium', 'Czech Republic', 'Finland', 'France', 
'Germany'],
    ['2003',  1336060,   3817614,       974066,       1104797,   6651824, 
 15727003],
    ['2004',  1538156,   3968305,       928875,       1151983,   5940129, 
 17356071],
    ['2005',  1576579,   4063225,       1063414,      1156441,   5714009, 
 16716049],
    ['2006',  1600652,   4604684,       940478,       1167979,   6190532, 
 18542843],
    ['2007',  1968113,   4013653,       1037079,      1207029,   6420270, 
 19564053],
    ['2008',  1901067,   6792087,       1037327,      1284795,   6240921, 
 19830493]
    ]);

    var view  = new google.visualization.DataView(data);

    var columns = [0];
    for (var i = 1; i < data.getNumberOfColumns(); i++) {
    // add a column that calculates the proportional value of this column 
to the total
    columns.push({
        type: 'number',
        label: data.getColumnLabel(i),
        calc: (function (col) {
            return function (dt, row) {
                var val = dt.getValue(row, col);
                var total = 0;
                for (var j = 1; j < dt.getNumberOfColumns(); j++) {
                    total += dt.getValue(row, j);
                }
                return (total == 0) ? null : {v: val / total, f: 
val.toString()}; 
            };
        })(i)
    });
    // add an annotation column that puts a label on the bar
    columns.push({
        type: 'string',
        role: 'annotation',
        sourceColumn: i,
        calc: 'stringify'
    });
    }

     view.setColumns(columns);

    var options = {
    title:"Yearly Coffee Consumption by Country",
    width:1000, height:400,
    isStacked: true,
    hAxis: {title: "Year"},
    vAxis: {
        format: '#%'
    }
    };
     var chart = new   
google.visualization.ColumnChart(document.getElementById('visualization'));
    chart.draw(view, options);

    }
    google.load('visualization', '1', {packages:['corechart'], callback: 
drawVisualization});

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to