Bootstrap

Echarts数据可视化 【正态分布:Q-Q图】

option = {
  title: {
    text: ' Q-Q图'
  },
  legend: {
    top: '5%',
    left: 'center'
  },
  toolbox: {
    feature: {
      saveAsImage: { show: true }
    }
  },
  xAxis: {},
  yAxis: {},
  series: [
    {
      name: '实际值',
      type: 'scatter',
      xAxisIndex: 0,
      yAxisIndex: 0,
      symbol: 'emptyCircle',
      symbolSize: 6,
      value: 0,
      data: [
        [10.0, 8.04],
        [8.0, 6.95],
        [13.0, 7.58],
        [9.0, 8.81],
        [11.0, 8.33],
        [14.0, 9.96],
        [6.0, 7.24],
        [4.0, 4.26],
        [12.0, 10.84],
        [7.0, 4.82],
        [5.0, 5.68]
      ]
    },
    {
      name: '预测值',
      type: 'line',
      lineStyle: {
        type: 'solid'
      },
      symbol: 'none',
      data: [
        8.090839639563, 8.898036315608316, 9.410064698880888, 9.795175165232816,
        10.108383251564906, 10.374933446654133, 18.358083734525945,
        18.501749405245455, 18.65414258927877, 18.8168518719317,
        18.99194402832822, 19.182182252371398, 19.391386676929162,
        19.625066553345867, 19.89161674843509, 20.204824834767184,
        20.589935301119112, 21.10196368439168, 21.909160360437
      ]
    }
  ]
};

 // 格式化数据方法
      formatFun: (params) => {
        return new Promise((resolve, reject) => {
          let res = params.res
          let option = params.option
          let data=[]
          let data1=[]
          let x =res.value.line_x
          let y =res.value.line_y
          let l =res.value.norm_line
          for (let i = 0; i <x.length ; i++) {
            data.push([x[i],y[i]])
          }
          for (let i = 0; i <x.length ; i++) {
            data1.push([x[i],l[i]])
          }
          option.series[0].data = data
          option.series[1].data = data1
          resolve({ option: option })
        })
      }

在这里插入图片描述

;