Редактировать:
Добавлено текущий прогресс < /p>
Код: Выделить всё
const ctx = document.getElementById('LineFill').getContext('2d');
const data = {
labels: ['2020', '2021', '2022', '2023'],
datasets: [
{
label: 'Dataset 1',
data: [1,3,5,7],
backgroundColor: 'transparent',
borderDash: [10, 5],
borderColor: '#1189D0',
},
{
label: 'Dataset 2',
data: [1,2,3],
borderColor: '#001946',
backgroundColor: '#001946',
fill: 'start',
tension: 0.9,
borderRadius: 5,
},
],
};
const config = {
type: 'line',
data: data,
options: {
responsive: true,
plugins: {
legend: {
display: false
},
},
scales: {
x: {
stacked: false,
ticks: {
display: true
},
},
y: {
stacked: false,
beginAtZero: true,
}
}
}
};
new Chart(ctx, config);< /code>
Подробнее здесь: https://stackoverflow.com/questions/797 ... n-chart-js