loulijun2021
2024-05-09 b1876ef3cdcb819e4799fe0d5c84f95bdb96529b
src/utils/myEcharts.js
@@ -327,26 +327,28 @@
        }
      }
    },
    series: [{
      name: '时间',
      type: 'line',
      smooth: false,
      showAllSymbol: true,
      symbol: 'emptyCircle',
      symbolSize: 8,
      itemStyle: {
        normal: {
          color: `rgba(42, 197, 137, 1)`
        }
      },
      lineStyle: {
        normal: {
          width: 2,
          color: `rgba(42, 197, 137, 1)`
        }
      },
      data: dataY
    }]
    series: [
      {
        name: '时间',
        type: 'line',
        smooth: false,
        showAllSymbol: true,
        symbol: 'emptyCircle',
        symbolSize: 8,
        itemStyle: {
          normal: {
            color: `rgba(42, 197, 137, 1)`
          }
        },
        lineStyle: {
          normal: {
            width: 2,
            color: `rgba(42, 197, 137, 1)`
          }
        },
        data: dataY
      }
    ]
  }
  return option
@@ -358,6 +360,7 @@
  // const titlename = ['外观划伤', '表面油污', '尺寸', '颜色', '大小']
  // const data = val.map(i => i.cont)
  // const titlename = val.map(i => i.name)
  const data = dataArr.filter((item, index) => index < 5)
  const titlename = titlenameArr.filter((item, index) => index < 5)
@@ -423,7 +426,7 @@
          color: function(value, index) {
            return value === '0' ? 'transparent' : '#fff'
          },
          fontSize: 20,
          fontSize: 16,
          // formatter: function(value, index) {
          //   return [
          //     '{lg|' + (index + 1) + '、   }' + '{title|' + value + '} '
@@ -2643,7 +2646,7 @@
  }
}
export function cjzl03_2(xData, legendData, yData, show) { // 左侧
export function cjzl03_2(xData, yData) { // 左侧
  return {
    backgroundColor: 'transparent',
    // tooltip: {},
@@ -2741,7 +2744,7 @@
    ],
    series: [
      {
        name: legendData[0],
        type: 'line',
        // smooth: true, //是否平滑曲线显示
        //          symbol:'circle',  // 默认是空心圆(中间是白色的),改成实心圆
@@ -2770,216 +2773,25 @@
        tooltip: {
          show: false
        },
        // areaStyle: { // 区域填充样式
        //   normal: {
        //     // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
        //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
        //       offset: 0,
        //       color: 'rgba(0,154,120,1)'
        //     },
        //     {
        //       offset: 1,
        //       color: 'rgba(0,0,0, 0)'
        //     }
        //     ], false),
        //     shadowColor: 'rgba(53,142,215, 0.9)', // 阴影颜色
        //     shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
        //   }
        // },
        data: yData[0]
      },
      {
        name: legendData[1],
        type: 'line',
        // smooth: true, //是否平滑曲线显示
        //          symbol:'circle',  // 默认是空心圆(中间是白色的),改成实心圆
        showAllSymbol: true,
        symbol: 'emptyCircle',
        symbolSize: 6,
        lineStyle: {
        areaStyle: { // 区域填充样式
          normal: {
            color: '#ff3000' // 线条颜色
          },
          borderColor: '#ff3000'
        },
        label: {
          show: true,
          position: 'top',
          textStyle: {
            fontSize: 16,
            color: '#fff'
            // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
              offset: 0,
              color: 'rgba(0,154,120,1)'
            },
            {
              offset: 1,
              color: 'rgba(0,0,0, 0)'
            }
            ], false),
            shadowColor: 'rgba(53,142,215, 0.9)', // 阴影颜色
            shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
          }
        },
        itemStyle: {
          normal: {
            color: '#ff3000'
          }
        },
        tooltip: {
          show: false
        },
        // areaStyle: { // 区域填充样式
        //   normal: {
        //     // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
        //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
        //       offset: 0,
        //       color: 'rgba(0,154,120,1)'
        //     },
        //     {
        //       offset: 1,
        //       color: 'rgba(0,0,0, 0)'
        //     }
        //     ], false),
        //     shadowColor: 'rgba(53,142,215, 0.9)', // 阴影颜色
        //     shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
        //   }
        // },
        data: yData[1]
      },
      {
        name: legendData[2],
        type: 'line',
        // smooth: true, //是否平滑曲线显示
        //          symbol:'circle',  // 默认是空心圆(中间是白色的),改成实心圆
        showAllSymbol: true,
        symbol: 'emptyCircle',
        symbolSize: 6,
        lineStyle: {
          normal: {
            color: '#ffa800' // 线条颜色
          },
          borderColor: '#ffa800'
        },
        label: {
          show: true,
          position: 'top',
          textStyle: {
            fontSize: 16,
            color: '#fff'
          }
        },
        itemStyle: {
          normal: {
            color: '#ffa800'
          }
        },
        tooltip: {
          show: false
        },
        // areaStyle: { // 区域填充样式
        //   normal: {
        //     // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
        //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
        //       offset: 0,
        //       color: 'rgba(0,154,120,1)'
        //     },
        //     {
        //       offset: 1,
        //       color: 'rgba(0,0,0, 0)'
        //     }
        //     ], false),
        //     shadowColor: 'rgba(53,142,215, 0.9)', // 阴影颜色
        //     shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
        //   }
        // },
        data: yData[2]
      },
      {
        name: legendData[3],
        type: 'line',
        // smooth: true, //是否平滑曲线显示
        //          symbol:'circle',  // 默认是空心圆(中间是白色的),改成实心圆
        showAllSymbol: true,
        symbol: 'emptyCircle',
        symbolSize: 6,
        lineStyle: {
          normal: {
            color: '#ffee00' // 线条颜色
          },
          borderColor: '#ffee00'
        },
        label: {
          show: true,
          position: 'top',
          textStyle: {
            fontSize: 16,
            color: '#fff'
          }
        },
        itemStyle: {
          normal: {
            color: '#ffee00'
          }
        },
        tooltip: {
          show: false
        },
        // areaStyle: { // 区域填充样式
        //   normal: {
        //     // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
        //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
        //       offset: 0,
        //       color: 'rgba(0,154,120,1)'
        //     },
        //     {
        //       offset: 1,
        //       color: 'rgba(0,0,0, 0)'
        //     }
        //     ], false),
        //     shadowColor: 'rgba(53,142,215, 0.9)', // 阴影颜色
        //     shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
        //   }
        // },
        data: yData[3]
      },
      {
        name: legendData[4],
        type: 'line',
        // smooth: true, //是否平滑曲线显示
        //          symbol:'circle',  // 默认是空心圆(中间是白色的),改成实心圆
        showAllSymbol: true,
        symbol: 'emptyCircle',
        symbolSize: 6,
        lineStyle: {
          normal: {
            color: '#ff5b00' // 线条颜色
          },
          borderColor: '#ff5b00'
        },
        label: {
          show: true,
          position: 'top',
          textStyle: {
            fontSize: 16,
            color: '#fff'
          }
        },
        itemStyle: {
          normal: {
            color: '#ff5b00'
          }
        },
        tooltip: {
          show: false
        },
        // areaStyle: { // 区域填充样式
        //   normal: {
        //     // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
        //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
        //       offset: 0,
        //       color: 'rgba(0,154,120,1)'
        //     },
        //     {
        //       offset: 1,
        //       color: 'rgba(0,0,0, 0)'
        //     }
        //     ], false),
        //     shadowColor: 'rgba(53,142,215, 0.9)', // 阴影颜色
        //     shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
        //   }
        // },
        data: yData[4]
        data: yData
      }
    ]
  }
}