This commit is contained in:
hzz 2023-11-28 15:44:30 +08:00
parent 6c008c7224
commit 1d999e5b6f

View File

@ -83,15 +83,29 @@ let SewingTime = reactive({
}, },
grid: { grid: {
left: "3%", left: "3%",
right: "4%", right: "10%",
bottom: "3%", bottom: "3%",
containLabel: true, containLabel: true,
}, },
xAxis: { xAxis: [
{
type: "value", type: "value",
name: "缝纫时间",
// boundaryGap: [0, 0.01] axisLabel: {
formatter: "{value}",
}, },
},
{
type: "value",
name: "用电量",
// min: 0,
// max: 100,
// interval: 20,
axisLabel: {
formatter: "{value}",
},
},
],
yAxis: { yAxis: {
type: "category", type: "category",
name: "min", name: "min",
@ -124,6 +138,27 @@ let SewingTime = reactive({
}, },
}, },
}, },
{
name: '用电量',
type: "bar",
XAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value;
},
},
data: [],
label: {
normal: {
show: true,
position: "right",
textStyle: {
color: "rgb(255,255,255,0.9)",
},
},
},
},
], ],
}, },
}); });
@ -184,12 +219,16 @@ watch(
(newVal, oldVal) => { (newVal, oldVal) => {
let y = []; let y = [];
let x = []; let x = [];
let z = []
newVal.forEach((res) => { newVal.forEach((res) => {
y.push(res.name); y.push(res.name);
x.push(res.workTime); x.push(res.workTime);
//
z.push((res.runTime/10).toFixed(2))
}); });
SewingTime.option.yAxis.data = y; SewingTime.option.yAxis.data = y;
SewingTime.option.series[0].data = x; SewingTime.option.series[0].data = x;
SewingTime.option.series[1].data = z;
chartref.value.changeData(SewingTime.option); chartref.value.changeData(SewingTime.option);
}, },
{ deep: true, flush: "post" } { deep: true, flush: "post" }