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: {
left: "3%",
right: "4%",
right: "10%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "value",
// boundaryGap: [0, 0.01]
},
xAxis: [
{
type: "value",
name: "缝纫时间",
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "用电量",
// min: 0,
// max: 100,
// interval: 20,
axisLabel: {
formatter: "{value}",
},
},
],
yAxis: {
type: "category",
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) => {
let y = [];
let x = [];
let z = []
newVal.forEach((res) => {
y.push(res.name);
x.push(res.workTime);
//
z.push((res.runTime/10).toFixed(2))
});
SewingTime.option.yAxis.data = y;
SewingTime.option.series[0].data = x;
SewingTime.option.series[1].data = z;
chartref.value.changeData(SewingTime.option);
},
{ deep: true, flush: "post" }