Basic Chart.JS Line Chart

Prices chart

by pepperdigital

HTML

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script>

<canvas id="myChart" width="80" height="40"></canvas>

JavaScript

var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
    // The type of chart we want to create
    type: 'line',  


    // The data for our dataset
    data: {
        labels: ["day1", "day2", "day3", "day4", "day5", "day6", "day7"],
        datasets: [{
            borderColor: 'rgba(215,25,28,1)',
            
              data: [2304, 2334, 2314, 2304, 2304, 2304, 2324],
              pointRadius: [0,0,0,0,0,0,4],
              pointBackgroundColor: 'rgba(215,25,28,1)',

      
        }]
    },

		
    // Configuration options go here
    options: {

   		 scales: {
  				 x: {
   				   display: false,
 							  },
						   y: {
 					     display: false,
						   }
},
    			title:{
        		display: false,
        	}, 
         plugins: {
        legend:{
        		display: false,
        	},
          tooltip: {
          enabled: false,
          }
          },
          

        legend: false
    
    }
});