EChartX,Y轴滑动滚动条添加设置实例代码粘贴即⽤
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="MeCharts" >
</div>
</body>
<script src="cdn.bootcdn/ajax/libs/echarts/5.0.0-beta.2/echarts.min.js"></script>
<script>
var MeOption = {
grid: {
left: '3%',
top: '0',
bottom: '0',
right: '5%',
containLabel: true
},
xAxis: {
show: false
},
yAxis: {
axisLine: {
show: false
},
axisLabel: {
color: '#CED1DE',
},
axisTick: {
show: false
},
type: 'category',
data: ['潍城区', '奎⽂区', '坊⼦区', '寒亭区', '青州市', '诸城市', '寿光市', '安丘市', '⾼密市', '昌⾢市', '临朐县', '昌乐县'],        },
//y轴滚动条
dataZoom: [{
type: 'slider',
//隐藏或显⽰(true)组件
show: true,
start: 60,
end: 10,
yAxisIndex: 0,
filterMode: 'empty',
width: 10,
//滚动条⾼度
height: '80%',
//滚动条显⽰位置
left: '95%',
handleSize: 8,
zoomLoxk: true,
top: 'middle',
textStyle: {
color: "#fff",
fontSize: 10,
},
}, ],
series: [{
type: 'bar',
itemStyle: {
barBorderRadius: 10,
color: aphic.LinearGradient(
0, 0, 1, 0, [{
offset: 0,
win10滚动条设置color: '#88D4FC'
}, {
offset: 1,
color: '#1DCCC9'
}]
)
},
label: {
show: true,
position: 'right',
color: '#1DCCC9'
},
barWidth: 10,
data: [578, 245, 321, 160, 282, 177, 198, 578, 245, 321, 160, 282]        }]
};
var MeCharts = echarts.ElementById("MeCharts"));
MeCharts.setOption(MeOption);
</script>
</html>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。