DataTable from SQL to Line Chart

58 views
Skip to first unread message

Jishnu U

unread,
Nov 6, 2012, 4:17:14 PM11/6/12
to google-visua...@googlegroups.com
Hi
Im trying to plot a datatable on my website using google Line chart. 

i tried as follows:

 <script type="text/javascript">

    

      google.load("visualization", "1", {packages:["corechart"]});

    

      google.setOnLoadCallback(drawChart);

    

      function drawChart() {

    

      var data='<%=data()%>'; //this is C# code which returns the datatable

        var options = {

          title: 'DATA'

        };

  var chart = new google.visualization.LineChart(document.getElementById('chart_div'));

        chart.draw(data, options);

      }

      </script>

But the chart gives an error : Data table is not defined.


Can anyone tell me what I did wrong here??

regards

Jishnu

asgallant

unread,
Nov 6, 2012, 8:07:26 PM11/6/12
to google-visua...@googlegroups.com
What does the rendered code look like (open in a browser and view the page source)?
Reply all
Reply to author
Forward
0 new messages