Small javascript project

This project received 35 bids from talented freelancers with an average bid price of $424 USD.

Get free quotes for a project like this
Project Budget
$250 - $750 USD
Total Bids
Project Description

I have a website that uses google charts. My typical usage of charts is like this ..

<script type="text/javascript">

[url removed, login to view]("visualization", "1", {packages:["corechart"]});

[url removed, login to view](drawChart);

function drawChart() {

var data = [url removed, login to view]([["Response","Percent"],["Energy",3],["Materials",0],["Industrials",0],["Consumer Discretionary",0],["Consumer Staples",1],["Health",0],["Financials",5],["Government",0],["Information Technology",1],["Telecommunications",2],["Utilities",0],["Education",0],["Other",3]]);

var options = {

legend : "right",

title: "Poll responses",

width: 600,


backgroundColor: { fill:"transparent" },

titleFontSize: 12,

tooltip: {trigger: "none" },

titleTextStyle: {color: "#000066"}


var chart = new [url removed, login to view]([url removed, login to view]("chart_div1"));

[url removed, login to view](data, options);



<div id="chart_div1"></div>


I now need to modify the above method so that the code - instead of being static - is injected into the document and then run - something along these lines ..

[url removed, login to view] = <something like the code above>

I've experimented with various solutions proposed on the net but can't get any to work. I've attached a working static version and an example of a not-working dynamic version.

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online