1.显示滑动条主要代码
dataZoom:[ { type:"slider",//slider表示有滑动块的, show:true, xAxisIndex:[0],//表示x轴折叠 start:1,//数据窗口范围的起始百分比,表示1% end:100,//数据窗口范围的结束百分比,表示35%坐标 bottom:"20", }, ],
2.x轴字体倾斜显示
axisLabel: { color: "#999", //x轴字体颜色 interval:0,//代表显示所有x轴标签显示 rotate:40, textStyle: { fontSize: 16, },
3.完整代码
调用this.leftCharts(listx,listy) 进行传参 //柱状图 leftCharts(allArr, titleArr) { var option = { backgroundColor: "#08173600", tooltip: { trigger: "axis", axisPointer: { type: "shadow", }, }, dataZoom:[ { type:"slider",//slider表示有滑动块的,