Problem Injecting Javascript

11 views
Skip to first unread message

George Agiasoglou

unread,
Nov 8, 2011, 9:26:26 AM11/8/11
to google-we...@googlegroups.com
Hi there, 

Is it possible to inject something like this and expect it to work?

google.load('visualization', '1', {'packages': ['table', 'corechart']});google.setOnLoadCallback(drawVisualization); function drawVisualization() {var wrap = new google.visualization.ChartWrapper({'chartType':'LineChart','location.to.data&transpose=1&headers=1&range=A2%3AAD5&gid=2&pub=1','containerId':'mychart','options':{'chartArea':{left:5,top:0,width:'75%',height:'75%'},'vAxes':[{'min':null,'title':null,'max':null}],'series':{'0':{'color':'#000000'},'1':{'color':'#666666'},'2':{'color':'#cccccc'}},'reverseCategories':false,'title':'','pointSize':'2','backgroundColor':'#FFFFFF','legend':'right','logScale':false,'reverseAxis':false,'hasLabelsColumn':true,'hAxis':{'maxAlternation':1},'isStacked':false,'width':600,'height':371}});wrap.draw();}

I am aware about gwt wrappers for google viz and ajaxloader etc but they do not fit my case. I need to be transparent and agnostic on how I load a third party library, because I will be using more than one. I've tried creating a script element and a div for the chart to be drawn but my module gets unloaded as soon as the script is added to the document, or to the body or to another div. I believe this happens because a JavascriptException is being thrown.

Any suggestions? 

Thanks,
G

Reply all
Reply to author
Forward
0 new messages