Advertisement
AndreyPetrov

Untitled

May 29th, 2020
1,414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function drawPlot(new_data,left,right){
  2.  
  3.     /*var speedData = {
  4.     labels:labelV,
  5.     datasets: [
  6.     {  
  7.         backgroundColor: 'rgb(99,99,132)',
  8.         pointBorderColor: 'orange',
  9.         pointBackgroundColor: 'rgba(100,150,0,0)',
  10.         }
  11.     ]
  12.     };
  13.  
  14.     var chartOptions = {
  15.         tooltips: {
  16.         enabled: true,
  17.         mode: 'label'
  18.     },
  19.     legend: {
  20.        
  21.         display: true,
  22.         position: 'top',
  23.         labels: {
  24.             boxWidth: 80,
  25.             fontColor: 'black'
  26.         }
  27.     },
  28.    
  29.         title:{
  30.             display:true,
  31.             text:'Plot'
  32.            
  33.             },
  34.        
  35.         scales:{
  36.             xAxes:[{
  37.                 ticks:{
  38.                     min:left,
  39.                     max:right,
  40.                     stepSize:1,
  41.                 },
  42.            
  43.             }],
  44.             yAxes:[{
  45.                 gridLines:{
  46.                     offsetGridLines:true
  47.                 }
  48.             }]
  49.            
  50.         }
  51.     }*/
  52.     lineChart = new Chart(speedCanvas, {
  53.         type: 'line',
  54.             data: {
  55.                 labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug"],
  56.                 datasets: [{
  57.                     label: '# of Value',
  58.                     data: [12, 19, 3, 5, 2, 3, 10, 29],
  59.                     backgroundColor: 'Black',
  60.                     borderColor: 'rgba(33, 145, 81, 1)',
  61.                     borderWidth: 1
  62.                 }]
  63.             },
  64.             options: {
  65.                 scales: {
  66.                     yAxes: [{
  67.                         ticks: {
  68.                             beginAtZero:true
  69.                         }
  70.                     }]
  71.                 }
  72.             }
  73.         });
  74.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement