|
|
@@ -12,7 +12,7 @@
|
|
|
end-placeholder="结束日期"
|
|
|
:picker-options="pickerOptions" >
|
|
|
</el-date-picker>
|
|
|
- <div ref="barChart" style="width: 1200px; height: 700px;margin: 5% 0 0 20%"></div> <!-- 这里指定了柱状图的宽高 -->
|
|
|
+ <div ref="barChart" style="width: 700px; height: 400px;margin-top: 3%"></div> <!-- 这里指定了柱状图的宽高 -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -114,14 +114,15 @@ export default {
|
|
|
// 提取 X 轴和 Y 轴的数据
|
|
|
const day = this.cabinetData.map(item => item.day)
|
|
|
const allCount = this.cabinetData.map(item => item.allCount)
|
|
|
- const returnCount=this.cabinetData.map(item => item.returnCount)
|
|
|
- const timeoutCount=this.cabinetData.map(item => item.timeoutCount)
|
|
|
+ const returnCount = this.cabinetData.map(item => item.returnCount)
|
|
|
+ const timeoutCount = this.cabinetData.map(item => item.timeoutCount)
|
|
|
+
|
|
|
// 配置图表的选项
|
|
|
const options = {
|
|
|
title: {
|
|
|
text: '每日领取归还统计',
|
|
|
left: 'center',
|
|
|
- top: '1%'
|
|
|
+ top: '0%'
|
|
|
},
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
@@ -135,13 +136,13 @@ export default {
|
|
|
toolbox: {
|
|
|
feature: {
|
|
|
dataView: { show: true, readOnly: false },
|
|
|
- magicType: { show: true, type: ['line', 'bar'] },
|
|
|
+ magicType: { show: true, type: ['line', 'bar'] }, // 保留切换功能
|
|
|
restore: { show: true },
|
|
|
saveAsImage: { show: true }
|
|
|
}
|
|
|
},
|
|
|
legend: {
|
|
|
- data: ['累计领取次数','累计正常归还次数','累计超时归还次数'],
|
|
|
+ data: ['累计领取次数', '累计正常归还次数', '累计超时归还次数'],
|
|
|
top: '5%', // 调整图例距离顶部的距离,确保图例在标题下方
|
|
|
left: 'center', // 图例居中显示
|
|
|
},
|
|
|
@@ -168,46 +169,45 @@ export default {
|
|
|
],
|
|
|
series: [
|
|
|
{
|
|
|
- name: '累计领取次数', // 修改为适当的名称
|
|
|
- type: 'line',
|
|
|
- barWidth: '25%',
|
|
|
-
|
|
|
+ name: '累计领取次数',
|
|
|
+ type: 'bar', // 改为柱状图
|
|
|
+ stack: 'total', // 启用堆叠效果
|
|
|
tooltip: {
|
|
|
valueFormatter: function (value) {
|
|
|
- return value + ' 次'; // 修改单位为 次
|
|
|
+ return value + ' 次';
|
|
|
}
|
|
|
},
|
|
|
data: allCount,
|
|
|
itemStyle: {
|
|
|
- color: '#5470c6', // 设置柱子的颜色为蓝色(你可以根据需要修改)
|
|
|
+ color: '#5470c6', // 设置柱子的颜色
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- name: '累计正常归还次数', // 修改为适当的名称
|
|
|
- type: 'line',
|
|
|
- barWidth: '25%',
|
|
|
+ name: '累计正常归还次数',
|
|
|
+ type: 'bar', // 改为柱状图
|
|
|
+ stack: 'total', // 启用堆叠效果
|
|
|
tooltip: {
|
|
|
valueFormatter: function (value) {
|
|
|
- return value + ' 次'; // 修改单位为 次
|
|
|
+ return value + ' 次';
|
|
|
}
|
|
|
},
|
|
|
data: returnCount,
|
|
|
itemStyle: {
|
|
|
- color: '#a6d58f', // 设置柱子的颜色为蓝色(你可以根据需要修改)
|
|
|
+ color: '#a6d58f', // 设置柱子的颜色
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- name: '累计超时归还次数', // 修改为适当的名称
|
|
|
- type: 'line',
|
|
|
- barWidth: '25%',
|
|
|
+ name: '累计超时归还次数',
|
|
|
+ type: 'bar', // 改为柱状图
|
|
|
+ stack: 'total', // 启用堆叠效果
|
|
|
tooltip: {
|
|
|
valueFormatter: function (value) {
|
|
|
- return value + ' 次'; // 修改单位为 次
|
|
|
+ return value + ' 次';
|
|
|
}
|
|
|
},
|
|
|
data: timeoutCount,
|
|
|
itemStyle: {
|
|
|
- color: '#fac85a', // 设置柱子的颜色为蓝色(你可以根据需要修改)
|
|
|
+ color: '#fac85a', // 设置柱子的颜色
|
|
|
}
|
|
|
}
|
|
|
]
|