body {
fontfamily: Arial, sansserif;
margin: 20px;
}
h1 {
textalign: center;
color: 333;
}
.chartcontainer {
width: 80%;
margin: 0 auto;
border: 1px solid ccc;
borderradius: 5px;
overflow: hidden;
}
stockchart {
width: 100%;
height: 400px;
}
const ctx = document.getElementById('stockchart').getContext('2d');
// Sample data for demonstration purposes
const dates = ['20210101', '20210201', '20210301', '20210401', '20210501', '20210601'];
const prices = [30000, 40000, 35000, 45000, 50000, 55000];
const stockChart = new Chart(ctx, {
type: 'line',
data: {
labels: dates,
datasets: [{
label: 'Bitcoin Stock Price',
data: prices,
borderColor: 'rgb(75, 192, 192)',
borderWidth: 2,
pointBackgroundColor: 'rgb(75, 192, 192)',
pointRadius: 5,
pointHoverRadius: 7,
pointHoverBackgroundColor: 'rgb(75, 192, 192)',
fill: false
}]
},
options: {
scales: {
y: {
beginAtZero: false
}
}
}
});