Advertisement
Giovanni_vangelista

html javascript char

Apr 11th, 2020
893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.24 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Acquaponica</title>
  5.     <meta charset="UTF-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1">
  7.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8.     <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js"></script>
  9.     <script src="https://www.chartjs.org/samples/latest/utils.js"></script>
  10.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  11.     <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
  12.     <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster">
  13.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  14.    
  15.     <style>
  16.     canvas{
  17.         -moz-user-select: none;
  18.         -webkit-user-select: none;
  19.         -ms-user-select: none;
  20.     }
  21.     body {
  22.         background-image: url("http://eskipaper.com/images/paper-background-4.jpg");
  23.     }
  24.     .w3-lobster {
  25.         font-family: "Lobster", serif;
  26.     }
  27.     </style>
  28. </head>
  29. <body onload="setInterval(reloadPage, 15000);">
  30.     <div class="w3-container w3-lobster">
  31.       <p class="w3-xxxlarge" align="center">HTML/JAVASCRIPT GRAFICO:</p>
  32.     </div>
  33.     <div class="container">
  34.         <canvas id="myChart"></canvas>
  35.     </div>
  36.     <br>
  37.     <div class="page-header-actions" data-toggle="buttons" role="group" align="center">
  38.         <label class="btn btn-outline btn-primary">
  39.             <input id="auto-refresh-checkbox" type="radio" name="options" autocomplete="off" value="autorefreshon"  />
  40.             <i class="icon wb-check text-active" aria-hidden="true"></i> Auto Refresh ON
  41.         </label>
  42.             <label class="btn btn-outline btn-primary">
  43.             <input type="radio" name="options" autocomplete="off" value="autorefreshoff" />
  44.             <i class="icon wb-check text-active" aria-hidden="true"></i> Auto Refresh OFF
  45.         </label>
  46.     </div>
  47. <script>
  48. var ctx = document.getElementById('myChart').getContext('2d');
  49. var myChart = new Chart(ctx, {
  50.     type: 'line',
  51.     data: {
  52.         labels: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'],
  53.         datasets: [{
  54.             label: 'temperature',
  55.             fill: false,
  56.             backgroundColor: window.chartColors.red,
  57.             borderColor: window.chartColors.red,
  58.             data: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,19,19,19,19,19]
  59.         },
  60.         {
  61.             label: 'Humidity',
  62.             fill: false,
  63.             backgroundColor: window.chartColors.blue,
  64.             borderColor: window.chartColors.blue,
  65.             data: [8, 20, 15, 18, 12, 13]
  66.         },
  67.         {
  68.             label: 'Ph',
  69.             fill: false,
  70.             backgroundColor: window.chartColors.orange,
  71.             borderColor: window.chartColors.orange,
  72.             data: [12, 15, 33, 5, 23, 3]
  73.         },
  74.         {
  75.             label: 'Ec',
  76.             fill: false,
  77.             backgroundColor: window.chartColors.green,
  78.             borderColor: window.chartColors.green,
  79.             data: [32, 1, 3, 15, 13, 32]
  80.         }
  81.         ]
  82.     },
  83.     options: {
  84.         responsive: true,
  85.     }
  86. });
  87.     function reloadPage(){
  88.       var refreshEnabled = document.getElementById('auto-refresh-checkbox');
  89.       if(refreshEnabled.checked) {
  90.         window.location.reload(60000);
  91.       }
  92.     }
  93. </script>
  94. </body>
  95. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement