personCharts.vue 1.14 KB
<template>
    <div class="_chart">
        <div class="_chartTitle">
            <h3>人群属性</h3>
            <span>统计近30天累计消费人群数据</span>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div id="consumptionLevel" style="width: 600px;height:400px"></div>
        </div>
        <div class="col-sm-6">
            <div id="vipDistribute" style="width: 600px;height:400px"></div>
        </div>
    </div>
</template>

<script type="text/javascript">
    var echarts = require('echarts');
    var getOption = require('./barChartOption');

    module.exports = {
        data:function() {
            return {
                name:"6666"
            }
        },
        ready:function(){
            var consumptionLevel = echarts.init(document.getElementById('consumptionLevel'));
            var vipDistribute = echarts.init(document.getElementById('vipDistribute'));

            var option = getYOption();

            // 使用刚指定的配置项和数据显示图表。
            consumptionLevel.setOption(option);
            vipDistribute.setOption(option);
        }
    }
</script>