Hi,

I want to display multiple (hundreds) of line charts on a single web-page. 
How do I do so? Would it be possible to write only one javascript function 
and pass the parameters for each graph to the same function?
I don't want to have hundreds of redundant javascript code blocks on the 
same html page.

Here is a snippet of my code for one chart:




























































*<HEAD><script type="text/javascript" src="https://www.google.com/jsapi 
<https://www.google.com/jsapi>"></script><script 
type="text/javascript">      google.load("visualization", "1", 
{packages:["corechart"]});      google.setOnLoadCallback(drawChart);    
function drawChart() {    var data = new 
google.visualization.DataTable();    //data.addColumn('number', 'X');    
data.addColumn('date', 'Extract Date');    data.addColumn('number', 'File 
Size (in bytes)');    data.addColumn('number', 'Record Count');    
data.addRows([        [new Date(2015,04, 19), 360536, 3851],        [new 
Date(2015,04, 20), 9712420, 96731],        [new Date(2015,04, 21), 9314494, 
94807],        [new Date(2015,04, 22), 8850065, 90029],        [new 
Date(2015,04, 23), 11075714, 124361],        [new Date(2015,04, 24), 
8855860, 90138],        [new Date(2015,04, 27), 3057707, 30282],        
[new Date(2015,04, 28), 8609144, 87688],        [new Date(2015,04, 29), 
8088795, 82579],        [new Date(2015,04, 30), 7293100, 74013],            
]);    var chart = new 
google.visualization.LineChart(document.getElementById('chart_div'));    
chart.draw(data, {        title: 'asset type / asset version',        
width: 1000,        height: 600,        series: {            0: 
{                targetAxisIndex: 0            },            1: 
{                targetAxisIndex: 1            }        },        vAxes: 
{            0: {                minValue: 0,                maxValue: 
11075714,                label: 'File Size (in bytes)',                
title: 'File Size (in bytes)'            },            1: {                
minValue: 0,                maxValue: 124361,                label: 'Record 
Count',                title: 'Record Count'            }        }    
});}</script><HEAD><div id="chart_div" style="width: 800px; height: 
300px;"></div>*

I want to pass the highlighted data as a parameter to the function 
'drawChart()' above.

(P.S. My question might be a basic one, but I am a novice in javascript or 
UI designing).

-- 
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