[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to pass ASP values to a javascript Google chart

Posted on 2013-11-04
1
Medium Priority
?
817 Views
Last Modified: 2013-11-04
How do I get my asp values to pass into the google chart below?


<%
Set rsset = Server.CreateObject("ADODB.Recordset")
 
	sql="SELECT builder, ytd_production, weekly_production, report_date "_
	& "FROM velocity_tick_history "_
	& "ORDER BY weekly_production DESC"
	
rsset.Open sql, conn
%>

<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable
        ([
         ['Builder','YTD', 'Week'],
         <%
         do while not rsset.eof
	         %>
	         [<%=rsset("builder")%>,<%=rsset("ytd_production")%>,<%=rsset("weekly_production")%>],
	         
	         <%
	         rsset.movenext
         loop
         %>
         
         ['ORL',66.36,68.94]
        ]);

        var options = {
          title: 'Velocity Tick History Report - Week of 10/21/13 - 10/25/13',
          vAxis: {title: 'Builder',  titleTextStyle: {color: 'red'}}
          //xAxis: {title: 'Production Percentage', titleTextStyle: {color: 'blue'}}
        };

        var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 900px; height: 700px;"></div>
  </body>
</html>

Open in new window

0
Comment
Question by:mfinocc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39622571
What does your rendered html look like and where is the error in your rendered html?

Maybe this
 <%
         do while not rsset.eof
	         %>
	         [<%=rsset("builder")%>,<%=rsset("ytd_production")%>,<%=rsset("weekly_production")%>],
	         
	         <%
	         rsset.movenext
         loop
         %>

Open in new window

should be
 <%
            do while not rsset.eof
	      %>[<%=rsset("builder")%>,<%=rsset("ytd_production")%>,<%=rsset("weekly_production")%>]<%
                if not rsset.eof then
                     response.write "," ' only add the comma if there is more data
                end if
	         rsset.movenext
         loop
         %>

Open in new window

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question