Browse Source

del charts for pcgchart1

lite
453530270@qq.com 3 years ago
parent
commit
6ca30d0ff1
  1. 173
      src/views/ty/index.vue

173
src/views/ty/index.vue

@ -131,7 +131,7 @@
</div> </div>
</div> </div>
<!-- <div id="pcgchart1" style="width: 100%;height: 25vh;margin-top: 20px;"></div> -->
</div> </div>
<!-- 各场馆服务人次趋势 --> <!-- 各场馆服务人次趋势 -->
<div class="pcgrliu"> <div class="pcgrliu">
@ -431,177 +431,6 @@ export default {
}, 200) }, 200)
}, },
ty_bar2() {
var chartDom = document.getElementById("pcgchart1");
var option
// var xData = function() {
// var data = [];
// for (var i = 2011; i < 2017; i++) {
// data.push(i + "");
// }
// return data;
// }();
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],
// [3.5, 15.2, 16.1, 17.4, 13.4, 6.1],
// [16.1, 13.5, 3.7, 17.4, 15.2, 18.9],
// [17.4, 6.1, 13.4, 15.2, 13.7, 5.2],
// [3.5, 15.2, 16.1, 17.4, 13.4, 6.1],
// [16.1, 13.5, 3.7, 17.4, 15.2, 18.9],
// [17.4, 6.1, 13.4, 15.2, 13.7, 5.2],
]
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: {
top: 0,
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',
},
},
tooltip: {
trigger: "axis",
axisPointer: { //
type: 'line', // 线'line' | 'shadow'
lineStyle: {
color: '#57617B'
}
},
formatter: '{b}<br />{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}',
backgroundColor: 'rgba(0,0,0,0.7)', //
padding: [8, 10], //
extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //
},
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,
}
setTimeout(()=>{
var myChart = echarts.init(chartDom);
option && myChart.setOption(option);
}, 200)
},
ty_bar3() { ty_bar3() {
var chartDom = document.getElementById("pcgchart2"); var chartDom = document.getElementById("pcgchart2");

Loading…
Cancel
Save