Javascript

save js2

本文主要是介绍save js2,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
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: {
          color: [
            '#313695',
            '#4575b4',
            '#74add1',
            '#abd9e9',
            '#e0f3f8',
            '#ffffbf',
            '#fee090',
            '#fdae61',
            '#f46d43',
            '#d73027',
            '#a50026'
          ]
        }
      },
      xAxis3D: {
        type: 'value'
      },
      yAxis3D: {
        type: 'value'
      },
      zAxis3D: {
        type: 'value',
        max: 20,
        min: 0
      },
      grid3D: {
        axisLine: {
          lineStyle: { color: '#fff' }
        },
        axisPointer: {
          lineStyle: { color: '#fff' }
        },
        viewControl: {
          // autoRotate: true
        },
        light: {
          main: {
            shadow: true,
            quality: 'ultra',
            intensity: 2.5
          }
        }
      },
      series: [
        {
          type: 'bar3D',
          data: data,
          shading: 'lambert',
          label: {
            formatter: function (param) {
              return param.value[2].toFixed(1);
            }
          }
        }
      ]
    })
  );

  

这篇关于save js2的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!