myChart.setOption({
title: {
text: '2024年全国降雨量统计',
show: true
},
tooltip: {},
xAxis3D: {
type: 'category',
data: ['0-100', '100-500', '500-1000', '1000-2000', '2000-5000', '5000以上']
},
yAxis3D: {
type: 'category',
data: ['降雨量']
},
zAxis3D: {
type: 'value'
},
grid3D: {
boxWidth: 200,
boxDepth: 80,
viewControl: {
alpha: 40,
beta: 40
}
},
series: [
{
name: '降雨量',
type: 'line3D',
data: [
[0, 0, Math.floor(Math.random() * 30)],
[1, 0, Math.floor(Math.random() * 30)],
[2, 0, Math.floor(Math.random() * 30)],
[3, 0, Math.floor(Math.random() * 30)],
[4, 0, Math.floor(Math.random() * 30)],
[5, 0, Math.floor(Math.random() * 30)]
],
shading: 'color',
lineStyle: {
width: 4,
color: '#c23531'
},
label: {
show: true,
formatter: '{b0}: {c2}'
}
}
]
})