For those trying to process data from a sql data base using vsbscript to create a line graph generating the setValue pairs from the data here is my code..
sqlQuery.Open qtxt, conn, 3, 3 sqlQuery.MoveFirst %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/ > <title>Google Visualization API Sample </title> <script type="text/javascript" src="http://www.google.com/jsapi"></ script> <script type="text/javascript"> google.load('visualization', '1', {packages: ['linechart']}); google.setOnLoadCallback(drawVisualization); 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 while (not sqlQuery.EOF) Do until y = -1 %> data.setValue(<%=ds0%>, <%=ds1%>, '<%=sqlQuery("Date") %>'); //date data.setValue(<%=ds0%>, <%=ds1+1%>, <%=sqlQuery ("LevelRecorded")%>); //levelrecorded <% x=0 z=z+1 ds0= ds0+1 ds1= 0 y = y - 1 sqlQuery.MoveNext loop Wend %> // Create and draw the visualization. var chart = new google.visualization.LineChart (document.getElementById('visualization')); chart.draw(data, {width: 950, height: 400, min: 0, smoothLine: false, axisColor: 'red', lineSize: 2, backgroundColor: '#FFFBE8', legend: "none", titleColor: 'maroon', title: "Montgomery County Pa \nGroundwater Well <%=strStationID%>", titleX:"Date of Reading", titleY: "Depth Below Land Surface Water Level in Feet"}); } </script> 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 -~----------~----~----~----~------~----~------~--~---
