/    Sign up×
Community /Pin to ProfileBookmark

generate dynamic data table

Hello all,
i was wondering if there is a way to dynamically generate one of these?
i’m writing in asp pulling my data, but i’m not sure how to insert my data with the correct format.
here is the page i got the code from.
[url]http://code.google.com/apis/visualization/documentation/gallery/motionchart.html#Example[/url]
thanx in advance for the help.

[code]
var data = new google.visualization.DataTable();
data.addRows(6);
data.addColumn(‘string’, ‘Fruit’);
data.addColumn(‘date’, ‘Date’);
data.addColumn(‘number’, ‘Sales’);
data.addColumn(‘number’, ‘Expenses’);
data.addColumn(‘string’, ‘Location’);
data.setValue(0, 0, ‘Apples’);
data.setValue(0, 1, new Date (1988,0,1));
data.setValue(0, 2, 1000);
data.setValue(0, 3, 300);
data.setValue(0, 4, ‘East’);
data.setValue(1, 0, ‘Oranges’);
data.setValue(1, 1, new Date (1988,0,1));
data.setValue(1, 2, 950);
data.setValue(1, 3, 200);
data.setValue(1, 4, ‘West’);
data.setValue(2, 0, ‘Bananas’);
data.setValue(2, 1, new Date (1988,0,1));
data.setValue(2, 2, 300);
data.setValue(2, 3, 250);
data.setValue(2, 4, ‘West’);
data.setValue(3, 0, ‘Apples’);
data.setValue(3, 1, new Date(1988,1,1));
data.setValue(3, 2, 1200);
data.setValue(3, 3, 400);
data.setValue(3, 4, “East”);
data.setValue(4, 0, ‘Oranges’);
data.setValue(4, 1, new Date(1988,1,1));
data.setValue(4, 2, 900);
data.setValue(4, 3, 150);
data.setValue(4, 4, “West”);
data.setValue(5, 0, ‘Bananas’);
data.setValue(5, 1, new Date(1988,1,1));
data.setValue(5, 2, 788);
data.setValue(5, 3, 617);
data.setValue(5, 4, “West”);
[/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JustXtremeauthorDec 17.2008 — I guess i'm good at asking impossible questions.
Copy linkTweet thisAlerts:
@FangDec 18.2008 — It doesn't appear to be possibleNote that this chart does not work when loading the HTML from a local file. It works only when loading the HTML from a web server.[/QUOTE]
×

Success!

Help @JustXtreme spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...