您所在的位置:首页 - 问答 - 正文问答
新能源起步速度对比图
镛桓
2024-04-24
【问答】
1051人已围观
摘要新能源起步速度对比图canvas{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;}constctx=docum
canvas{
mozuserselect: none;
webkituserselect: none;
msuserselect: none;
}
const ctx = document.getElementById('myChart').getContext('2d');
const myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Solar', 'Wind', 'Hydro', 'Biomass', 'Geothermal'],
datasets: [{
label: 'Growth Rate',
data: [25, 18, 15, 12, 20],
backgroundColor: [
'rgba(255, 159, 64, 0.2)',
'rgba(255, 205, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(54, 162, 235, 0.2)',

'rgba(153, 102, 255, 0.2)'
],
borderColor: [
'rgba(255, 159, 64, 1)',
'rgba(255, 205, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(54, 162, 235, 1)',
'rgba(153, 102, 255, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});