google’s jquery flot graph api using classic ASP


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Example</title>
    <!--[if IE]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
    <script language="javascript" type="text/javascript" src="jquery.js"></script>
    <script language="javascript" type="text/javascript" src="jquery.flot.js"></script>
</head>

<body>

    <div id="placeholder" style="width:600px;height:300px;"></div>

    <script id="source" language="javascript" type="text/javascript">
    $(function () {
        var d1 = [];

        <%
            SET ac = Server.CreateObject("ADODB.Connection") 

            ac.Open "driver={sql server}; server=localhost; database=db_name; uid=user; pwd=secret" 

            SET rs = Server.CreateObject("ADODB.Recordset") 
            SET rs = ac.Execute("SELECT data_x, data_y FROM data_log") 

            FOR EACH field IN rs.Fields    
               Response.Write "d1.push([" & field.data_x & ", " & field.data_y & "]);"    
            NEXT
        %>

        $.plot($("#placeholder"), [d1]);
    });
    </script>

</body>
</html>

One thought on “google’s jquery flot graph api using classic ASP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s