Advertisement
sqlninja1

Untitled

Feb 11th, 2015
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html>
  3.     <head>
  4.         <title>Line Chart</title>
  5.         <script src="../Chart.js"></script>
  6.         <meta name = "viewport" content = "initial-scale = 1, user-scalable = no">
  7.         <style>
  8.             canvas{
  9.             }
  10.         </style>
  11.     </head>
  12.     <body>
  13.         <canvas id="canvas" height="450" width="600"></canvas>
  14. <cfscript>
  15. q = queryNew('a,b,c');
  16. queryAddRow(q);
  17. querySetCell(q, 'a','bob');
  18. queryAddRow(q);
  19. querySetCell(q, 'a','jill');
  20. queryAddRow(q);
  21. querySetCell(q, 'a','frank');
  22. </cfscript>
  23.  
  24. <script>
  25.  
  26. var data = {
  27.     labels: ["January", "February", "March", "April", "May", "June", "July"],
  28.     datasets: [
  29.         {
  30.             label: "My First dataset",
  31.              data: <cfoutput>#serializeJSON(listToArray(valueList(q.a)))#</cfoutput>
  32.         },
  33.         {
  34.             label: "My Second dataset",
  35.             data: <cfoutput>#serializeJSON(listToArray(valueList(q.b)))#</cfoutput>
  36.         }
  37.     ]
  38. };
  39.  
  40. var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(data);
  41. </script>
  42.  
  43.  
  44.    
  45.     </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement