<template>
  <div>
        <h1 class="bt_h1">人口管理</h1>
        <div id="myEchart" style="width:100%;height:380px"></div>
    </div> 
  </div>
</template>

<script>
  module.exports = {
        data: function() {
            return {
              
            }
        }, 
        props:[],
        methods:{

        },
        mounted(){//挂载的时候执行
            initchart();
        }
  }

function initchart(){
    var echart = echarts.init(document.getElementById("myEchart"));
    option = {
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b}: {c} ({d}%)"
        },
        title: {
            text: '人口按年龄占比',
            left: 'center',
            textStyle: {
                color: 'white',
                fontSize: '12',
            },
        },
        color: ['#1CBCD6', '#FF4500', 'yellow', '#FFEFD5','#A52A2A','#71C671'],
        series: [
            {
                name: '年龄段',
                type: 'pie',
                radius: ['40%', '60%'],
              
                avoidLabelOverlap: false,
                label: {
                    normal: {
                        show: false,
                        position: 'center'
                    },
                    emphasis: {
                        show: true,
                        textStyle: {
                            fontSize: '30',
                            fontWeight: 'bold'
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: false
                    }
                },
                data: [
                    { value: 5231, name: '0-18岁' },
                    { value: 22346, name: '19-59岁' },
                    { value: 321, name: '60-69岁' },
                    { value: 135, name: '70-79岁' },
                    { value: 43, name: '80-89岁' },
                     { value: 7, name: '90及以上' }
                ]
            }
        ]
    };
    echart.setOption(option);
}
</script>
 
<style scoped>
    .bt_h1{
        text-align: center;
        font-size: 20px;
        color: white;
        font-weight: 500;
        margin-top: 8px;
    }
    .table-a table{border:1px solid #F00} 
    .bg_tr tr:hover{
        background-color: #ece5e500 ! important;
    }
    .bg_tr{
        color: #fff;
    }
    .bg_tr td{
       text-align: center;
    }
    .tr_th{
        background: linear-gradient(#415dc0, #9aaab5);
    }
    .tr_th th{
        text-align: center;
    }

</style>

