Hi,
my code is vbscript (microsoft classic asp) going against a microsoft
sql database.. The first part of the program opens the db/table and
writes the data (date and level recording value) into a 2 dimension
table array (myarray).
I was able to succeed with the 2nd part of retrieving the data from
the myarray table and generate each data.setvalue pairs
using a server-side loop.. The line graph was produced... I was
trying to build the setvalue pairs from the database data but this
seem to work using a table..
Regards,
TomP
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Date');
data.addColumn('number', 'LevelRecorded');
data.addRows(40);
<%
dim y, x, z, ds0, ds1
z=0
y=39
x=0
ds0=0
ds1=0
Do until y = -1
%>
data.setValue(<%=ds0%>, <%=ds1%>, '<%=MyArray(x,z)
%>'); //date
data.setValue(<%=ds0%>, <%=ds1+1%>, <%=MyArray(x+1,z)
%>); //levelrecorded
<%
x=0
z=z+1
ds0= ds0+1
ds1= 0
y = y - 1
loop
%>
Regards,
Tom
On Mar 2, 12:47 pm, VizBoy <[email protected]> wrote:
> Hi,
>
> What is this code? Is it php?
>
> Try to write an example (even a small one) with pure javascript and we'll
> try to help you debug it.
>
> Regards,
> VizBoy.
>
>
>
> On Wed, Feb 25, 2009 at 4:23 PM, TomP <[email protected]> wrote:
>
> > I'm trying to generate the dataset.Value pair values coming from a
> > table. It looks like the variables i, x, ds0 and ds1 are not being
> > updated after running thru the for loop...
>
> > Is anyone doing something similar or have another way without
> > hardcoding each pair.. My input data is coming from sql database that
> > I populate in an table.. so the input can big..
> > thanks in advance.. Tom
>
> > var y=0;
> > for (y=1;y<=6;y++)
> > {
>
> > data.setValue(ds0, ds1, '<%=MyArray(x,i+2)%>'); //
> > date
> > data.setValue(ds0, ds1+1, <%=MyArray(x+1,i+2)%>); //
> > levelrecorded
> > x=0;
> > i=i+2;
> > ds0= ds0+1;
> > ds1= 0;
> > }- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---