<canvas id="myChart" width="600" height="400"></canvas>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Северная Америка', 'Южная Америка', 'Ближний Восток', 'Евразия', 'Европа', 'Африка', 'Азия и Океания', 'Мир'],
datasets: [
{
label: '1992 год',
data: [3944.36, 513.16, 2854.78, 1561.42, 271.59, 324.07, 2715.54, 12184.91],
backgroundColor: 'rgba(255, 99, 132, 0.2)',
borderColor: 'rgba(255, 99, 132, 1)',
borderWidth: 1
},
{
label: '2000 год',
data: [4864.05, 761.13, 3376.76, 1270.96, 464.63, 432.74, 4220.14, 15391.00],
backgroundColor: 'rgba(54, 162, 235, 0.2)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1
},
{
label: '2010 год',
data: [5257.02, 1080.76, 3831.37, 1502.99, 887.58, 666.79, 8258.59, 21485.1],
backgroundColor: 'rgba(255, 206, 86, 0.2)',
borderColor: 'rgba(255, 206, 86, 1)',
borderWidth: 1
},
{
label: '2020 год',
data: [5226.49, 1253.18, 3697.28, 1573.67, 1219.15, 830.33, 12919.96, 26720.05],
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)',
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
Ответ: Построена диаграмма по данным таблицы 1.