areaCharts.vue 1.61 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="areaTop" style="width: 500px;height:400px"></div>
        </div>
        <div class="col-sm-6">
            <div id="shopTop" style="width: 500px;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 areaTop = echarts.init(document.getElementById('areaTop'));
            var shopTop = echarts.init(document.getElementById('shopTop'));

            var option = getXOption();

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

<style>
    ._chart{
        clear: both;
        width: 100%;
        font-family: 'microsoft yahei';
        color: #585858;
    }
    ._chartTitle{
        width: 100%;
        padding: 0 20px;
        height: 40px;
        background-color: #ddd;
    }
    ._chartTitle h3{
        float: left;
        line-height: 40px;
        font-size: 20px;
        margin: 0;
        font-weight: bold
    }
    ._chartTitle span{
        display: block;
        float: right;
        line-height: 40px;
        font-size: 14px;
    }
</style>