[JavaScript] 纯文本查看 复制代码 <!DOCTYPE html>
<html lang="zh-CN" style="height: 100%">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script>
<script type="text/javascript">
var dom = document.getElementById('container');
var myChart = echarts.init(dom, null, {
renderer: 'canvas',
useDirtyRect: false
});
var option = {
tooltip: {},
xAxis: {
axisLabel: {
show: false,
}
},
yAxis: {
show: false,
data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
},
series: [
{
type: 'bar',
data: [18203, 23489, 29034, 104970, 131744, 630230]
}
]
};
if (option && typeof option === 'object') {
myChart.setOption(option);
}
window.addEventListener('resize', myChart.resize);
</script>
</body>
</html> |