|
|
@@ -179,6 +179,11 @@ export default {
|
|
|
const chart = echarts.init(this.$refs.barChart)
|
|
|
this._barChart = chart
|
|
|
const data = this.chartData
|
|
|
+
|
|
|
+ const pageSize = 6
|
|
|
+ const total = data.length
|
|
|
+ const endPercent = total > pageSize ? (pageSize / total) * 100 : 100
|
|
|
+
|
|
|
chart.setOption({
|
|
|
legend: {
|
|
|
data: ['研究生', '本科生', '教职工'],
|
|
|
@@ -188,7 +193,8 @@ export default {
|
|
|
itemHeight: 14,
|
|
|
textStyle: { fontSize: 12, color: '#555' },
|
|
|
},
|
|
|
- grid: { top: 50, bottom: 56, left: 56, right: 20, containLabel: false },
|
|
|
+ // bottom 加大,给滚动条留空间
|
|
|
+ grid: { top: 50, bottom: 76, left: 56, right: 20, containLabel: false },
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
data: data.map(d => d.deptName),
|
|
|
@@ -207,6 +213,27 @@ export default {
|
|
|
axisLine: { show: false },
|
|
|
axisTick: { show: false },
|
|
|
},
|
|
|
+ dataZoom: [
|
|
|
+ {
|
|
|
+ type: 'slider',
|
|
|
+ show: true,
|
|
|
+ xAxisIndex: [0],
|
|
|
+ bottom: 10,
|
|
|
+ start: 0,
|
|
|
+ end: endPercent,
|
|
|
+ height: 14,
|
|
|
+ handleSize: '80%',
|
|
|
+ showDetail: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'inside',
|
|
|
+ xAxisIndex: [0],
|
|
|
+ start: 0,
|
|
|
+ end: endPercent,
|
|
|
+ zoomOnMouseWheel: false,
|
|
|
+ moveOnMouseMove: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
series: [
|
|
|
{
|
|
|
name: '研究生',
|