百度echarts利用南丁格尔图做一个上班摸鱼时间分布图

2025年02月21日 建站教程

如何利用百度echarts南丁格尔图做一个上班摸鱼时间分布图,下面给大家简单介绍一下实现代码!

实现代码如下:

var data = [];
var data2 = [];
for (var i = 0; i < 24; ++i) {
  data.push({
    value: Math.random() * 10 + 10 - Math.abs(i - 12),
    name: i + ':00'
  });
  data2.push({
    value: 1,
    name: i + ':00'
  });
}

option = {
  title: {
    text: '上班摸鱼时间',
    left: '50%',
    textAlign: 'center',
    top: '20%'
  },
  color: ['#22C3AA'],
  series: [{
    type: 'pie',
    data: data,
    roseType: 'area',
    itemStyle: {
      normal: {
        color: 'white',
        borderColor: '#22C3AA'
      }
    },
    labelLine: {
      normal: {
        show: false
      }
    },
    label: {
      normal: {
        show: false
      }
    }
  }, {
    type: 'pie',
    data: data2,
    radius: ['75%', '100%'],
    zlevel: -2,
    itemStyle: {
      normal: {
        color: '#22C3AA',
        borderColor: 'white'
      }
    },
    label: {
      normal: {
        position: 'inside'
      }
    }
  }]
};

本文链接:http://so.lmcjl.com/news/23589/

展开阅读全文
相关内容