areaCharts.vue
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<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>