Browse Source

增加这线面积图

master
453530270@qq.com 3 years ago
parent
commit
eef2b3b3cb
  1. 218
      src/views/TycView.vue

218
src/views/TycView.vue

@ -12,20 +12,20 @@
<div class="jgcon">
<div class="jgitem">
<div class="jgimg"><img src="../assets/icon01.png"/></div>
<div class="jgimg"><img src="../assets/icon01.png" /></div>
<span class="jgival">234,255</span>
<span class="jgdesc">今日进馆人数</span>
</div>
<div class="jgitem">
<div class="jgimg"><img src="../assets/icon02.png"/></div>
<div class="jgimg"><img src="../assets/icon02.png" /></div>
<span class="jgival">234,255</span>
<span class="jgdesc">本月进馆人数</span>
</div>
<div class="jgitem">
<div class="jgimg"><img src="../assets/icon03.png"/></div>
<div class="jgimg"><img src="../assets/icon03.png" /></div>
<span class="jgival">234,255</span>
<span class="jgdesc">本年进馆人数</span>
</div>
</div>
</div>
</div>
<!-- 进馆人数统计 -->
@ -33,8 +33,11 @@
<div class="gcins_title">进馆人数统计</div>
<div id="gcins_charts" style="height:16rem"></div>
</div>
<!-- 人数状态 -->
<div class="incbox"></div>
<!-- 各场馆人数趋势 -->
<div class="gcgrs">
<div class="gcgrs_title">各场馆人数趋势</div>
<div id="gc_charts" class="gcgrs_charts"></div>
</div>
</div>
</template>
@ -75,7 +78,8 @@
font-size: 2.02rem;
padding-top: 4.8rem;
}
.tyclogo .tydesc{
.tyclogo .tydesc {
height: 2rem;
line-height: 2rem;
font-size: 1.03rem;
@ -83,13 +87,15 @@
padding-right: 1.06rem;
color: #999;
}
/* 总计进馆 */
.jgbox{
.jgbox {
margin-top: 1.02rem;
width: 100%;
height: 12rem;
}
.jgbox .jg_title{
.jgbox .jg_title {
background-image: url('../assets/ty_jg_bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
@ -98,34 +104,41 @@
height: 2.06rem;
line-height: 2.06rem;
}
.jgbox .jgcon{
.jgbox .jgcon {
width: 100%;
height: 7rem;
padding-top: 2rem;
}
.jgbox .jgcon .jgitem{
.jgbox .jgcon .jgitem {
width: 30%;
margin-left: 3%;
float: left;
}
.jgbox .jgcon .jgitem .jgimg{
.jgbox .jgcon .jgitem .jgimg {
margin-left: auto;
margin-right: auto;
text-align: center;
}
.jgbox .jgcon .jgitem span{
.jgbox .jgcon .jgitem span {
display: block;
text-align: center;
height: 1.8rem;
line-height: 1.8rem;
}
.jgbox .jgcon .jgitem .jgival{
.jgbox .jgcon .jgitem .jgival {
font-size: 1.06rem;
}
.jgbox .jgcon .jgitem .jgdesc{
.jgbox .jgcon .jgitem .jgdesc {
color: #666;
font-size: 0.8rem;
}
/* 进馆人数统计 */
.gcins {
margin-top: 1.6rem;
@ -135,18 +148,31 @@
background-image: url("../assets/tyc_tbg.png");
background-position: 0 0;
background-repeat: no-repeat;
background-size: 100%;
background-size: 100% 100%;
height: 1.8rem;
line-height: 1.8rem;
padding-left: 2.02rem;
}
/* 进馆人数 */
.incbox{
margin-top: 1.2rem;
background: url("../assets/tyc_bhd.png") no-repeat 0 center;
background-size: 100%;
height: 8rem;
/* 各场馆人数趋势 */
.gcgrs {
margin-top: 1.06rem;
}
.gcgrs .gcgrs_title {
background-image: url("../assets/wh_tbg.png");
background-position: 0 0;
background-repeat: no-repeat;
background-size: 100%;
height: 1.8rem;
line-height: 1.8rem;
padding-left: 2.02rem;
}
.gcgrs .gcgrs_charts {
margin-top: 2rem;
width: 100%;
height: 17rem;
}
</style>
<script>
@ -159,7 +185,10 @@ export default {
}
},
mounted() {
//
this.cgsf_line()
//
this.cg_line()
},
methods: {
//
@ -292,6 +321,151 @@ export default {
option && myChart.setOption(option);
},
//
cg_line(){
var chartDom = document.getElementById("gc_charts");
var myChart = echarts.init(chartDom);
var option
var xData = ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00',];
var color = ['#FF99CC', '#6666FF', '#FF6600', '#7049f0', '#fa704d', '#01babc',]
var name = ['体育场', '体育馆', '游泳场馆']
var data = [
[137, 34, 135, 161, 74, 152, 110, 100, 150],
[174, 137, 135, 34, 152, 135, 140, 160, 100],
[134, 74, 137, 135, 161, 137, 300, 220, 250],
]
var series = [];
for (var i = 0; i < 6; i++) {
series.push({
name: name[i],
type: "line",
symbolSize: 3,// 10 [20, 10] 2010[ default: 4 ]
symbol: 'circle',//ECharts 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
smooth: true, //线
showSymbol: false, // symbol, false tooltip hover
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: color[i]
}, {
offset: 0.8,
color: 'rgba(255,255,255,0)'
}], false),
// shadowColor: 'rgba(255,255,255, 0.1)',
shadowBlur: 10,
opacity: 0.3,
}
},
itemStyle: {
normal: {
color: color[i],
lineStyle: {
width: 1,
type: 'solid' //'dotted'线 'solid'线
},
borderColor: color[i], // color
borderWidth: 8,//线 0 [ default: 0 ]
barBorderRadius: 0,
label: {
show: false,
},
opacity: 0.5,
}
},
data: data[i],
})
}
option = {
// backgroundColor: "#141f56",
legend: {
bottom: 20,
itemGap: 15,
itemWidth: 15,
textStyle: {
color: '#fff',
fontSize: '14'
},
data: name
},
title: {
// text: "",
textStyle: {
color: '#fff',
fontSize: '22',
fontWeight: 'normal',
},
subtextStyle: {
color: '#90979c',
fontSize: '16',
},
},
grid: {
borderWidth: 0,
top: 240,
bottom: 240,
textStyle: {
color: "#fff"
}
},
xAxis: [{
type: "category",
axisLine: {
show: false,
},
splitLine: {
show: false,
},
boundaryGap: false, //
axisTick: {
show: false
},
splitArea: {
show: false
},
axisLabel: {
inside: false,
textStyle: {
color: '#FFFFFF',
fontWeight: 'normal',
fontSize: '12',
},
},
data: xData,
}],
yAxis: {
type: 'value',
axisTick: {
show: false
},
axisLine: {
show: false,
},
splitLine: {
show: true,
lineStyle: {
color: '#32346c ',
}
},
axisLabel: {
textStyle: {
color: '#0095FF',
fontWeight: 'normal',
fontSize: '12',
},
formatter: '{value}',
},
},
series: series,
}
option && myChart.setOption(option);
},
},
}
</script>
Loading…
Cancel
Save