]
)
}
},
data: data
}
]
};
// Enable data zoom when user click bar.
var zoomSize = 6;
myChart.on(‘click’, function (params) {
console.log(dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)]);
myChart.dispatchAction({
type: ‘dataZoom’,
startValue: dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)],
endValue: dataAxis[Math.min(params.dataIndex + zoomSize / 2, data.length - 1)]
});
});
option && myChart.setOption(option);
接下来是css得代码
#title{
position: absolute;
width:40%;
height:10%;
top:0;
left : 30%;
background-color: #47c6e9;
font-size: 30px;
display:flex;
align-items:center;
justify-content:center;
}
#time{
position: absolute;
height:10%;
width: 30%;
top:0%;
right:0%;
font-size:20px;
background-color: #47c6e9;
}
#ls{
position: absolute;
height:10%;
width: 30%;
top:0%;
left:0%;
font-size:30px;
background-color: #47c6e9;
}
#z1{
position: absolute;
width:40%;
height:30%;
top:10%;
left : 30%;
background-color: #47c6e9;
/* background:#black; */
}
#z2{
position: absolute;
width:40%;
height:70%;
top:30%;
left : 30%;
/* background:white; */
}
#zuo1{
position: absolute;
wi