Hi guys, i am looking for help. I have been trying to get this to work for about 2 days now, and i just cant get it right!!!. I currently have 2 JavaScript files, that are linked to from a script tag in an ASP Page. I am trying to connect to a sql database and using the data to populate the graph. The 2 javascript files work, they are not the problem.
Script:
CODE
<script type="text/javascript" src="graph.js"></script>
<script type="text/javascript" src="line.js"></script>
<div id="lineCanvas" style="overflow: auto; position:relative;height:600px;width:700px;">
</div>
<script type="text/javascript">
var g = new line_graph();
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "TXTracker"
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT Date, Time_Spent FROM TXTracker ORDER BY ID Desc", conn
%>
<% do until rs.EOF
for each x in rs.Fields %>
g.add('<% Response.Write(rs("Date")) & "','" & (rs("Time_Spent")) %>');
<% next
rs.MoveNext %>
<% loop
rs.close
conn.close
%>
g.render("lineCanvas", "Line Graph");
</script>
For some reason, this is calling each line twice, for example,
CODE
g.add('17/11/2007','2.17');
g.add('17/11/2007','2.17');
These rows only appear once in the database. Where am i going wrong???