|
@@ -3,7 +3,7 @@
|
|
|
* @Author: wangcc
|
|
|
* @Date: 2023-01-11 15:39:49
|
|
|
* @LastEditors: wangcc
|
|
|
- * @LastEditTime: 2023-01-11 16:18:12
|
|
|
+ * @LastEditTime: 2023-01-28 14:39:02
|
|
|
* @FilePath: \parking_LargeScreen\src\components\charts\barCharts.vue
|
|
|
* @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved.
|
|
|
-->
|
|
@@ -16,165 +16,169 @@ export default {
|
|
|
name: 'BarCharts.vue',
|
|
|
props: ['option'],
|
|
|
mounted() {
|
|
|
- let scale = document.documentElement.clientWidth / 3840;
|
|
|
- //let scale = 1;
|
|
|
- let xData = this.option.xData;
|
|
|
- let yData = this.option.yData;
|
|
|
- let typeChart = this.$echarts.init(this.$refs.typeChart);
|
|
|
- let optionType = {
|
|
|
- backgroundColor: 'rgba(29, 35, 40, 0)',
|
|
|
- grid: {
|
|
|
- top: 60 * scale,
|
|
|
- right: 40 * scale,
|
|
|
- left: 120 * scale,
|
|
|
- bottom: 40 * scale
|
|
|
- },
|
|
|
- legend: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- tooltip:{
|
|
|
- trigger:'axis',
|
|
|
- },
|
|
|
- xAxis: [
|
|
|
- {
|
|
|
- type: 'category',
|
|
|
- data: xData,
|
|
|
- name: '(日)',
|
|
|
- nameTextStyle: {
|
|
|
- color: '#d5d6d7',
|
|
|
- padding: [10, 30, 0, 10],
|
|
|
- align: 'center',
|
|
|
- fontSize: 20 * scale,
|
|
|
- verticalAlign: 'top',
|
|
|
- fontFamily: 'AlibabaLight'
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- lineStyle: {
|
|
|
- color: '#4f6162',
|
|
|
- width: 2
|
|
|
- }
|
|
|
- },
|
|
|
- axisLabel: {
|
|
|
- margin: 10,
|
|
|
- color: '#fff',
|
|
|
- fontFamily: 'AlibabaLight',
|
|
|
- textStyle: {
|
|
|
- fontSize: 20 * scale
|
|
|
+ this.barChart();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ barChart() {
|
|
|
+ let scale = document.documentElement.clientWidth / 3840;
|
|
|
+ //let scale = 1;
|
|
|
+ let xData = this.option.xData;
|
|
|
+ let yData = this.option.yData;
|
|
|
+ let typeChart = this.$echarts.init(this.$refs.typeChart);
|
|
|
+ let optionType = {
|
|
|
+ backgroundColor: 'rgba(29, 35, 40, 0)',
|
|
|
+ grid: {
|
|
|
+ top: 60 * scale,
|
|
|
+ right: 40 * scale,
|
|
|
+ left: 120 * scale,
|
|
|
+ bottom: 50 * scale
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis'
|
|
|
+ },
|
|
|
+ xAxis: [
|
|
|
+ {
|
|
|
+ type: 'category',
|
|
|
+ data: xData,
|
|
|
+ name: '(日)',
|
|
|
+ nameTextStyle: {
|
|
|
+ color: '#d5d6d7',
|
|
|
+ padding: [10, 30, 0, 10],
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 20 * scale,
|
|
|
+ verticalAlign: 'top',
|
|
|
+ fontFamily: 'AlibabaLight'
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: '#4f6162',
|
|
|
+ width: 2
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ margin: 10,
|
|
|
+ color: '#fff',
|
|
|
+ fontFamily: 'AlibabaLight',
|
|
|
+ textStyle: {
|
|
|
+ fontSize: 20 * scale
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisTick: {
|
|
|
+ show: false
|
|
|
}
|
|
|
- },
|
|
|
- axisTick: {
|
|
|
- show: false
|
|
|
}
|
|
|
- }
|
|
|
- ],
|
|
|
- yAxis: [
|
|
|
- {
|
|
|
- name: '单位(元)',
|
|
|
- nameTextStyle: {
|
|
|
- //y轴上方单位的颜色
|
|
|
- color: '#fff',
|
|
|
- padding: [0, 16, 0, 5],
|
|
|
- align: 'center',
|
|
|
- verticalAlign: 'bottom',
|
|
|
- fontFamily: 'AlibabaRegular',
|
|
|
- fontSize: 18 * scale
|
|
|
- },
|
|
|
- axisLabel: {
|
|
|
- formatter: '{value}',
|
|
|
- color: '#fff',
|
|
|
- fontFamily: 'AlibabaLight',
|
|
|
- fontSize: 18 * scale
|
|
|
- },
|
|
|
- axisTick: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- show: false,
|
|
|
- lineStyle: {
|
|
|
- color: 'rgba(0,186,255,.6)'
|
|
|
- }
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- lineStyle: {
|
|
|
- color: 'rgba(255,255,255,0.12)',
|
|
|
- type: 'dotted'
|
|
|
+ ],
|
|
|
+ yAxis: [
|
|
|
+ {
|
|
|
+ name: '单位(元)',
|
|
|
+ nameTextStyle: {
|
|
|
+ //y轴上方单位的颜色
|
|
|
+ color: '#fff',
|
|
|
+ padding: [0, 16, 0, 5],
|
|
|
+ align: 'center',
|
|
|
+ verticalAlign: 'bottom',
|
|
|
+ fontFamily: 'AlibabaRegular',
|
|
|
+ fontSize: 18 * scale
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ formatter: '{value}',
|
|
|
+ color: '#fff',
|
|
|
+ fontFamily: 'AlibabaLight',
|
|
|
+ fontSize: 18 * scale
|
|
|
+ },
|
|
|
+ axisTick: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ show: false,
|
|
|
+ lineStyle: {
|
|
|
+ color: 'rgba(0,186,255,.6)'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: 'rgba(255,255,255,0.12)',
|
|
|
+ type: 'dotted'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- ],
|
|
|
- series: [
|
|
|
- // {
|
|
|
- // type: 'bar',
|
|
|
- // data: yData,
|
|
|
- // barWidth: 14 * scale,
|
|
|
- // itemStyle: {
|
|
|
- // normal: {
|
|
|
- // color: new this.$echarts.graphic.LinearGradient(
|
|
|
- // 0,
|
|
|
- // 0,
|
|
|
- // 0,
|
|
|
- // 1,
|
|
|
- // [
|
|
|
- // {
|
|
|
- // offset: 0,
|
|
|
- // color: '#009FCF' // 0% 处的颜色
|
|
|
- // },
|
|
|
- // {
|
|
|
- // offset: 1,
|
|
|
- // color: '#00C4FF' // 100% 处的颜色
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // false
|
|
|
- // ),
|
|
|
- // opacity: 1,
|
|
|
- // shadowColor: 'rgba(0, 196, 255,0.7)',
|
|
|
- // shadowBlur: 4
|
|
|
- // },
|
|
|
- // emphasis: {
|
|
|
- // color: new this.$echarts.graphic.LinearGradient(
|
|
|
- // 0,
|
|
|
- // 0,
|
|
|
- // 0,
|
|
|
- // 1,
|
|
|
- // [
|
|
|
- // {
|
|
|
- // offset: 0,
|
|
|
- // color: '#FFFFFF' // 0% 处的颜色
|
|
|
- // },
|
|
|
- // {
|
|
|
- // offset: 1,
|
|
|
- // color: '#FFFFFF' // 100% 处的颜色
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // false
|
|
|
- // ),
|
|
|
- // opacity: 1,
|
|
|
- // shadowBlur: 8,
|
|
|
- // barWidth: 10
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
- {
|
|
|
- name: '近30日实收分析',
|
|
|
- type: 'line',
|
|
|
- data: yData,
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- label: {
|
|
|
- show: true
|
|
|
- },
|
|
|
- color: '#FFF', //改变折线点的颜色
|
|
|
- lineStyle: {
|
|
|
- color: '#00C4FF' //改变折线颜色
|
|
|
+ ],
|
|
|
+ series: [
|
|
|
+ // {
|
|
|
+ // type: 'bar',
|
|
|
+ // data: yData,
|
|
|
+ // barWidth: 14 * scale,
|
|
|
+ // itemStyle: {
|
|
|
+ // normal: {
|
|
|
+ // color: new this.$echarts.graphic.LinearGradient(
|
|
|
+ // 0,
|
|
|
+ // 0,
|
|
|
+ // 0,
|
|
|
+ // 1,
|
|
|
+ // [
|
|
|
+ // {
|
|
|
+ // offset: 0,
|
|
|
+ // color: '#009FCF' // 0% 处的颜色
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // offset: 1,
|
|
|
+ // color: '#00C4FF' // 100% 处的颜色
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // false
|
|
|
+ // ),
|
|
|
+ // opacity: 1,
|
|
|
+ // shadowColor: 'rgba(0, 196, 255,0.7)',
|
|
|
+ // shadowBlur: 4
|
|
|
+ // },
|
|
|
+ // emphasis: {
|
|
|
+ // color: new this.$echarts.graphic.LinearGradient(
|
|
|
+ // 0,
|
|
|
+ // 0,
|
|
|
+ // 0,
|
|
|
+ // 1,
|
|
|
+ // [
|
|
|
+ // {
|
|
|
+ // offset: 0,
|
|
|
+ // color: '#FFFFFF' // 0% 处的颜色
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // offset: 1,
|
|
|
+ // color: '#FFFFFF' // 100% 处的颜色
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // false
|
|
|
+ // ),
|
|
|
+ // opacity: 1,
|
|
|
+ // shadowBlur: 8,
|
|
|
+ // barWidth: 10
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ name: '近30日实收分析',
|
|
|
+ type: 'line',
|
|
|
+ data: yData,
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ label: {
|
|
|
+ show: true
|
|
|
+ },
|
|
|
+ color: '#FFF', //改变折线点的颜色
|
|
|
+ lineStyle: {
|
|
|
+ color: '#00C4FF' //改变折线颜色
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- typeChart.setOption(optionType);
|
|
|
- },
|
|
|
- methods: {}
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ typeChart.setOption(optionType,true);
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|