Advertisement
Guest User

Untitled

a guest
Dec 26th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. <html>
  2. <body style="background-color:#636363;">
  3. <meta charset="utf-8">
  4. <title>Online RED</title>
  5. </body>
  6. <head>
  7. <!--Load the AJAX API-->
  8. <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  9. <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
  10. <script src="jquery.csv.min.js"></script>
  11. <script src="jquery.csv-0.71.js"></script>
  12. <script type="text/javascript">
  13. google.load('visualization', '1.0', {'packages':['corechart']});
  14. google.setOnLoadCallback(BasicLine);
  15.  
  16. function BasicLine() {
  17. $.get("example.csv", function(csvString) {
  18. var arrayData = $.csv.toArrays(csvString,
  19. {onParseValue: $.csv.hooks.castToScalar}),
  20. data = new google.visualization.arrayToDataTable(arrayData),
  21. options = {
  22. hAxis: {title: 'Time'},
  23. width: (window.innerWidth-20), height: (window.innerHeight-20),
  24. curveType: 'function',
  25. vAxis: {title: 'Online'},
  26. //pointSize: 1,
  27. trendlines: {0: {type: 'exponential', visibleInLegend: true, color: 'green',}},
  28. backgroundColor: '#636363'},
  29. chart = new google.visualization.LineChart(document.getElementById('chart_div'));
  30. //var chart = new google.charts.Line(document.getElementById('linechart_material'));
  31. //chart.draw(data, google.charts.Line.convertOptions(options));
  32. chart.draw(data, options);
  33.  
  34. },
  35. 'text');
  36. }
  37. </script>
  38. </head>
  39.  
  40. <body>
  41. <!--Div that will hold the pie chart-->
  42. <div id="chart_div"></div>
  43. </body>
  44.  
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement