其他分享
首页 > 其他分享> > save JS

save JS

作者:互联网

function generateData() {
    var data = [];
    for (var i = 0; i <= 20; i++) {
      for (var j = 0; j <= 20; j++) {
        for (var k = 0; k <= 20; k++) {
          data.push([i, j, k, Math.random(10)*5+16 ]);
        }
      }
    }
    return data;
  }
var data = generateData();
myChart.setOption(
    (option = {
      visualMap: {
        show: false,
        min: 2,
        max: 20,
        inRange: {
          symbolSize: [0.5, 25],
          color: [
            '#313695',
            '#4575b4',
            '#74add1',
            '#abd9e9',
            '#e0f3f8',
            '#ffffbf',
            '#fee090',
            '#fdae61',
            '#f46d43',
            '#d73027',
            '#a50026'
          ],
          colorAlpha: [0.2, 1]
        }
      },
      xAxis3D: {
        type: 'value'
      },
      yAxis3D: {
        type: 'value'
      },
      zAxis3D: {
        type: 'value'
      },
      grid3D: {
        axisLine: {
          lineStyle: { color: '#fff' }
        },
        axisPointer: {
          lineStyle: { color: '#fff' }
        },
        viewControl: {
          // autoRotate: true
        }
      },
      series: [
        {
          type: 'scatter3D',
          data: data
        }
      ]
    })
  );

  

标签:function,generateData,JS,var,save,data
来源: https://www.cnblogs.com/conpi/p/16435084.html