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

31
package-lock.json

@ -3492,6 +3492,22 @@
"stream-shift": "^1.0.0" "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": { "ee-first": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://r2.cnpmjs.org/ee-first/-/ee-first-1.1.1.tgz", "resolved": "https://r2.cnpmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@ -12346,6 +12362,21 @@
"dev": true "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": { "dependencies": {
"@qiun/vue-ucharts": "^2.5.0-20230101", "@qiun/vue-ucharts": "^2.5.0-20230101",
"echarts": "^5.4.2",
"less": "^4.1.3", "less": "^4.1.3",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"vue": "^2.5.2", "vue": "^2.5.2",

2
src/App.vue

@ -1,6 +1,5 @@
<template> <template>
<div id="app"> <div id="app">
<!-- <img src="./assets/logo.png"> -->
<router-view/> <router-view/>
</div> </div>
</template> </template>
@ -19,5 +18,6 @@ export default {
text-align: center; text-align: center;
color: #2c3e50; color: #2c3e50;
margin-top: 60px; */ margin-top: 60px; */
width: 100%;
} }
</style> </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 { .bfb {
width: 100%; width: 100%;
height: 25%; height: 25%;
background-image: url("../../assets/tiyuguan/人流饱和度.png"); background-image: url("../../assets/tiyuguan/pins_bh.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
position: relative; position: relative;

2
src/components/stadium/stadium.vue

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

2
src/components/tiyuchang/tiyuchang.vue

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

127
src/components/zongLan/zongLan.vue

@ -17,7 +17,11 @@
</div> </div>
</div> </div>
<div class="tongjitu"></div> <div
class="tongjitu"
id="homebar"
style="height: 230px; width: 680px"
></div>
<div class="qushiBaifb"> <div class="qushiBaifb">
<div class="baifbLeft"> <div class="baifbLeft">
@ -261,13 +265,14 @@
</div> </div>
</template> </template>
<script> <script>
// echarts
import * as echarts from "echarts";
var uChartsInstance = {}; var uChartsInstance = {};
export default { export default {
data() { data() {
return { return {
msg: "Welcome to Your Vue.js App",
selectVal: 1, selectVal: 1,
keliuList: [ keliuList: [
{ {
@ -281,17 +286,129 @@ export default {
}, },
], ],
selectVal1: "年", selectVal1: "年",
}; };
}, },
mounted() {
// 线
this.home_bar();
},
methods: { methods: {
clickItme(val) { clickItme(val) {
this.selectVal = val; this.selectVal = val;
}, },
clickQushi(val) { clickQushi(val) {
this.selectVal1 = 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> </script>

1
src/router/index.js

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

Loading…
Cancel
Save