Browse Source

调整条形图

lite
xyiege 3 years ago
parent
commit
74dfa720dd
  1. 2
      index.html
  2. 31
      package-lock.json
  3. 1
      package.json
  4. 2
      src/App.vue
  5. BIN
      src/assets/tiyuguan/人流饱和度.png
  6. 2
      src/components/library/index.vue
  7. 2
      src/components/stadium/stadium.vue
  8. 2
      src/components/tiyuchang/tiyuchang.vue
  9. 127
      src/components/zongLan/zongLan.vue
  10. 1
      src/router/index.js

2
index.html

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>tiyuguan</title>
<title>宝安区公共文化体育服务中心智慧显示屏</title>
</head>
<body style="margin: 0;">
<div id="app"></div>

31
package-lock.json

@ -3492,6 +3492,22 @@
"stream-shift": "^1.0.0"
}
},
"echarts": {
"version": "5.4.2",
"resolved": "https://r.cnpmjs.org/echarts/-/echarts-5.4.2.tgz",
"integrity": "sha512-2W3vw3oI2tWJdyAz+b8DuWS0nfXtSDqlDmqgin/lfzbkB01cuMEN66KWBlmur3YMp5nEDEEt5s23pllnAzB4EA==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.4.3"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://r.cnpmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://r2.cnpmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@ -12346,6 +12362,21 @@
"dev": true
}
}
},
"zrender": {
"version": "5.4.3",
"resolved": "https://r.cnpmjs.org/zrender/-/zrender-5.4.3.tgz",
"integrity": "sha512-DRUM4ZLnoaT0PBVvGBDO9oWIDBKFdAVieNWxWwK0niYzJCMwGchRk21/hsE+RKkIveH3XHCyvXcJDkgLVvfizQ==",
"requires": {
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://r.cnpmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
}
}
}

1
package.json

@ -11,6 +11,7 @@
},
"dependencies": {
"@qiun/vue-ucharts": "^2.5.0-20230101",
"echarts": "^5.4.2",
"less": "^4.1.3",
"less-loader": "^4.1.0",
"vue": "^2.5.2",

2
src/App.vue

@ -1,6 +1,5 @@
<template>
<div id="app">
<!-- <img src="./assets/logo.png"> -->
<router-view/>
</div>
</template>
@ -19,5 +18,6 @@ export default {
text-align: center;
color: #2c3e50;
margin-top: 60px; */
width: 100%;
}
</style>

BIN
src/assets/tiyuguan/人流饱和度.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

2
src/components/library/index.vue

@ -384,7 +384,7 @@ export default {
.bfb {
width: 100%;
height: 25%;
background-image: url("../../assets/tiyuguan/人流饱和度.png");
background-image: url("../../assets/tiyuguan/pins_bh.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: relative;

2
src/components/stadium/stadium.vue

@ -384,7 +384,7 @@ export default {
.bfb {
width: 100%;
height: 25%;
background-image: url("../../assets/tiyuguan/人流饱和度.png");
background-image: url("../../assets/tiyuguan/pins_bh.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: relative;

2
src/components/tiyuchang/tiyuchang.vue

@ -387,7 +387,7 @@ export default {
.bfb {
width: 100%;
height: 25%;
background-image: url("../../assets/tiyuguan/人流饱和度.png");
background-image: url("../../assets/tiyuguan/pins_bh.png");
background-repeat: no-repeat;
background-size: 100% 100%;
position: relative;

127
src/components/zongLan/zongLan.vue

@ -17,7 +17,11 @@
</div>
</div>
<div class="tongjitu"></div>
<div
class="tongjitu"
id="homebar"
style="height: 230px; width: 680px"
></div>
<div class="qushiBaifb">
<div class="baifbLeft">
@ -261,13 +265,14 @@
</div>
</template>
<script>
<script>
// echarts
import * as echarts from "echarts";
var uChartsInstance = {};
export default {
data() {
return {
msg: "Welcome to Your Vue.js App",
selectVal: 1,
keliuList: [
{
@ -281,17 +286,129 @@ export default {
},
],
selectVal1: "年",
};
},
mounted() {
// 线
this.home_bar();
},
methods: {
clickItme(val) {
this.selectVal = val;
},
clickQushi(val) {
this.selectVal1 = val;
},
//
home_bar() {
var chartDom = document.getElementById("homebar");
var myChart = echarts.init(chartDom);
var option;
option = {
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun","0c","90","10"],
},
yAxis: {
type: "value",
//线
splitLine:{
lineStyle:{
type:"soild",
color:'#2F00FF'
}
}
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130,630,530,460],
type: "bar",
showBackground: true,
//
symbolSize:function(d){
console.log(d)
return d>0?[10,barWidth]:[0,0]
},
symbolPosition:'end',
// symbolPosition:'end',
//
backgroundStyle: {
symbolPosition:'end',
symbolSize:[20,20],
symbolOffset:[0,"-20%"],
opacity:0.75,
//color: 'rgba(180, 180, 180, 0.2)'
color: {
type: "linear",
x: 0,
y: 1,
x2: 1,
y2: 1,
colorStops: [
{
offset: 0,
color: "#2F00FF", // 0%
},
{
offset: 0.2,
color: "#000", // 50%
},
{
offset: 0.8,
color: "#000", // 50%
},
{
offset: 1,
color: "#2F00FF", // 0%
}
],
global: false, // false
},
},
//
// itemStyle:{
// normal:{
// barBorderRadius:[2,2,0,0]
// }
//symbolOffset:[14,14],
//borderRadius:[15,15,0,0]
// },
//
color: {
type: "linear",
x: 0,
y: 1,
x2: 1,
y2: 1,
colorStops: [
{
offset: 0,
color: "#00B4FF", // 0%
},
{
offset:0.6,color:"#2f00ff"
},
{
offset:0.8,color:"#2f00ff",
},
{
offset: 1,
color: "#00B4FF", // 100%
},
],
global: false, // false
},
},
],
};
option && myChart.setOption(option);
},
},
};
</script>

1
src/router/index.js

@ -6,6 +6,7 @@ import zongLan from '@/components/zongLan/zongLan'
import tiyuchang from '@/components/tiyuchang/tiyuchang'
import stadium from '@/components/stadium/stadium'
import library from '@/components/library/index'
import { name } from 'file-loader'
Vue.use(Router)

Loading…
Cancel
Save