效果图:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
</head>
<body>
<div id="app" style="height:300px;"></div>
<div id="fun"></div>
<script src="../js/echarts.js"></script>
<script>
let option = {
tooltip: {
trigger: "axis",
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "line" // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
show: false
},
grid: {
top: "10",
left: "70",
right: "30",
bottom: "30"
},
xAxis: [
{
type: "category",
data: ["数据依赖", "执行级别", "性别", "级别", "测试类型"]
}
],
yAxis: [
{
type: "value"
}
],
series: [
{
name: "是",
type: "bar",
stack: "属性",
label: {
show: true,