修改数据

master
夜笙歌 4 weeks ago
parent de895908a2
commit c7842694bb

@ -321,78 +321,96 @@ export default {
this.form.STATION_NAME = row.STATION_NAME
this.open = true
this.title = '缺陷明细'
// this.$refs.chart1.setData({
// tooltip: {
// trigger: 'axis',
// axisPointer: {
// type: 'shadow'
// }
// },
// grid: {
// left: "0",
// right: "4%",
// bottom: "0",
// top: 20,
// containLabel: true,
// },
// xAxis: [
// {
// type: 'category',
// data: response.data.map(val => val.QUALITY_DEFECT_NAME),
// axisTick: {
// alignWithLabel: true,
// },
// axisLabel: {
// interval: 0
//
// }
// }
// ],
// yAxis: [
// {
// type: 'value'
// }
// ],
// series: [
// {
// name: '',
// type: "bar",
// barWidth: '30%',
// barMaxWidth: 50,
// label: {
// normal: {
// show: true,
// position: "top",
// formatter: (e) => {
// if (e.data === 0) {
// return ''
// } else {
// }
// return e.data
// },
// textStyle: {
// color: "#a8aab0",
// fontStyle: "normal",
// fontFamily: "",
// fontSize: 0.75 * vw,
// },
// },
// },
// itemStyle: {
// normal: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "#4adfff",
// },
// {
// offset: 1,
// color: "#3d7aff",
// },
// ]),
// },
// },
// data: response.data.map(val => val.DEFECT_NUMBER),
// }
// ]
// })
this.$refs.chart1.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: "0",
right: "4%",
bottom: "0",
top: 20,
containLabel: true,
trigger: 'item'
},
xAxis: [
{
type: 'category',
data: response.data.map(val => val.QUALITY_DEFECT_NAME),
axisTick: {
alignWithLabel: true,
},
axisLabel: {
interval: 0
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '缺陷数量',
type: "bar",
barWidth: '30%',
barMaxWidth: 50,
label: {
normal: {
show: true,
position: "top",
formatter: (e) => {
if (e.data === 0) {
return ''
} else {
}
return e.data
},
textStyle: {
color: "#a8aab0",
fontStyle: "normal",
fontFamily: "微软雅黑",
fontSize: 0.75 * vw,
},
},
},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#4adfff",
},
{
offset: 1,
color: "#3d7aff",
},
]),
},
},
data: response.data.map(val => val.DEFECT_NUMBER),
name: '缺陷名称',
type: 'pie',
radius: '60%',
data: response.data.map(e=>{
return {
name:e.QUALITY_DEFECT_NAME,
value:e.DEFECT_NUMBER
}
}),
}
]
})
@ -426,7 +444,7 @@ export default {
<style>
.chart1 {
width: 50%;
height: 240px;
height: 30vw;
margin-top: 12px;
position: absolute;
top: 50%;

Loading…
Cancel
Save