修改界面

master
夜笙歌 4 years ago
parent 269d0c47b2
commit c550b714fb

@ -176,7 +176,6 @@ $(() => {
}, '#cardOne') }, '#cardOne')
break break
case '安全检测': case '安全检测':
debugger
arr = data.find(val => val.code === '安全检测').list.sort(function (a, b) { arr = data.find(val => val.code === '安全检测').list.sort(function (a, b) {
return b.qty - a.qty return b.qty - a.qty
}) })

@ -85,27 +85,27 @@ $(() => {
xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name),
yData: yDataOne, yData: yDataOne,
yDataName: "内胆检漏" yDataName: "内胆检漏"
}, document.getElementById("equipmentPowerOne")) }, document.getElementById("equipmentPowerOne"),undefined,undefined,'#389af4')
lineChart({ lineChart({
xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name),
yData: yDataTwo, yData: yDataTwo,
yDataName: "安全检测" yDataName: "安全检测"
}, document.getElementById("equipmentPowerTwo")) }, document.getElementById("equipmentPowerTwo"),undefined,undefined,'#ff8c37')
lineChart({ lineChart({
xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name),
yData: yDataThree, yData: yDataThree,
yDataName: "成品检漏" yDataName: "成品检漏"
}, document.getElementById("equipmentPowerThree")) }, document.getElementById("equipmentPowerThree"),undefined,undefined,'#ffc257')
lineChart({ lineChart({
xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name),
yData: yDataFour, yData: yDataFour,
yDataName: "测温性能" yDataName: "测温性能"
}, document.getElementById("equipmentPowerFour")) }, document.getElementById("equipmentPowerFour"),undefined,undefined,'#fd6f97')
lineChart({ lineChart({
xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name), xName: data.find(val => val.code == '横坐标')?.list.map(val => val.name),
yData: yDataFive, yData: yDataFive,
yDataName: "成品外观" yDataName: "成品外观"
}, document.getElementById("equipmentPowerFive")) }, document.getElementById("equipmentPowerFive"),undefined,undefined,'#a181fc')
// pieChart(data.map((val, index) => { // pieChart(data.map((val, index) => {
// if (index == 0 ) { // if (index == 0 ) {
// return { // return {

@ -946,19 +946,17 @@ const barChartAndLineChartFour = function (data, id) {
} }
// 折线图 // 折线图
const lineChart = function (data, id, unit = '',smooth=false) { const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
let charts = echarts.init(id); let charts = echarts.init(id);
if (!data) { if (!data) {
data = { data = {
xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
yData: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73], yData: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],
yDataName: "提升百分比", yDataName: "提升百分比",
yDataTwo: [60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60],
yDataTwoName: "百分比"
} }
} }
let min = Math.ceil(Math.min(...data.yData,...(data.yDataTwo || []))) let min = Math.ceil(Math.min(...data.yData))
let max = Math.ceil(Math.max(...data.yData,...(data.yDataTwo || []))) let max = Math.ceil(Math.max(...data.yData))
let option = { let option = {
grid: { grid: {
top: '28%', top: '28%',
@ -1050,12 +1048,12 @@ const lineChart = function (data, id, unit = '',smooth=false) {
symbolSize: 4, //标记的大小 symbolSize: 4, //标记的大小
itemStyle: { itemStyle: {
//折线拐点标志的样式 //折线拐点标志的样式
color: '#14bd2d', color: color,
borderWidth: '2', borderWidth: '2',
borderColor: '#14bd2d', borderColor: color,
}, },
lineStyle: { lineStyle: {
color: '#14bd2d', color: color,
}, },
label: { label: {
//图形上的文本标签 //图形上的文本标签
@ -1064,7 +1062,7 @@ const lineChart = function (data, id, unit = '',smooth=false) {
show: true, show: true,
position: "top", position: "top",
textStyle: { textStyle: {
color: "#14bd2d", color: color,
fontStyle: "normal", fontStyle: "normal",
fontFamily: "微软雅黑", fontFamily: "微软雅黑",
fontSize: 0.5 * vw, fontSize: 0.5 * vw,
@ -1073,58 +1071,6 @@ const lineChart = function (data, id, unit = '',smooth=false) {
}, },
data: data.yData, data: data.yData,
}, },
{
name: data.yDataTwoName,
type: 'line',
smooth:smooth,
showAllSymbol: true, //显示所有图形。
symbol: 'circle', //标记的图形为实心圆
symbolSize: 4, //标记的大小
itemStyle: {
//折线拐点标志的样式
color: '#3094ea',
borderWidth: '2',
borderColor: '#3094ea',
},
lineStyle: {
color: '#3094ea',
},
label: {
//图形上的文本标签
normal: {
formatter: `{c}${unit}`,
show: true,
position: "top",
textStyle: {
color: "#3094ea",
fontStyle: "normal",
fontFamily: "微软雅黑",
fontSize: 0.5 * vw,
},
},
},
// areaStyle: {
// normal: {
// color: new echarts.graphic.LinearGradient(
// 0,
// 0,
// 0,
// 1,
// [
// {
// offset: 0,
// color: "rgb(76,82,193,0.7)",
// },
// {
// offset: 0.8,
// color: "rgb(191,194,220,0.4)",
// },
// ],
// ),
// },
// },
data: data.yDataTwo,
},
], ],
}; };

Loading…
Cancel
Save