From 73b40d54554307ced5aab5b89dff6e1980e8a242 Mon Sep 17 00:00:00 2001
From: zmc <zmc_li@foxmail.com>
Date: 星期四, 26 十月 2023 16:48:01 +0800
Subject: [PATCH] 分险排名页面增加站点清单 辅助审核增加了选择日期以及查看详情页面的样式调整
---
src/views/line_graph/components/LineChart.vue | 53 +++++++++++++++++++++++------------------------------
1 files changed, 23 insertions(+), 30 deletions(-)
diff --git a/src/views/line_graph/components/LineChart.vue b/src/views/line_graph/components/LineChart.vue
index 9c2ef43..e509576 100644
--- a/src/views/line_graph/components/LineChart.vue
+++ b/src/views/line_graph/components/LineChart.vue
@@ -3,11 +3,11 @@
浣跨敤鍚屼竴涓浘褰㈠疄渚嬶紝鎺ュ彈鐖剁粍浠朵紶鍏ョ殑鎶樼嚎鍥緊ption
-->
<template>
- <div ref="chart" class="line-chart"></div>
+ <div ref="chart" class="line-chart11"></div>
</template>
<script>
-import * as _echarts from 'echarts';
+import * as _echarts from 'echarts'
export default {
props: {
@@ -18,7 +18,7 @@
return {
x: [],
y: []
- };
+ }
}
},
title: {
@@ -40,28 +40,23 @@
data() {
return {
chart: null
- };
+ }
},
mounted() {
- this.intiChart();
- window.addEventListener('resize', this.resizeChart);
+ this.intiChart()
+ window.addEventListener('resize', this.resizeChart)
},
watch: {
chartData() {
// option鍙樺寲鏃讹紝鍥惧舰鍐嶆鍒濆鍖�
- this.setOption();
- },
-
+ this.setOption()
+ }
},
- // beforeUnmount() {
- // if (this.chart) {
- // this.chart.dispose();
- // }
- // },
+
methods: {
intiChart() {
// 鍒涘缓echarts瀹炰緥
- this.chart = _echarts.init(this.$refs.chart);
+ this.chart = _echarts.init(this.$refs.chart)
},
setOption() {
@@ -88,11 +83,11 @@
name: this.xName,
data: this.chartData.x,
type: 'category',
- axisLabel: {
- formatter: function (value) {
- return value.slice(5);
- }
+ axisLabel: {
+ formatter: function (value) {
+ return value.slice(5)
}
+ }
},
yAxis: {
type: 'value',
@@ -109,27 +104,25 @@
data: this.chartData.y
}
]
- };
- this.chart.setOption(option);
+ }
+ this.chart.setOption(option)
},
// 璺熼〉闈㈠搷搴斿紡鍙樺寲
resizeChart() {
- // this.chart.resize();
- this.$nextTick(() => {
- if (this.chart) {
- this.chart.resize();
- }
- });
+ setTimeout(() => {
+ this.chart.resize()
+ }, 1000)
}
}
-};
+}
</script>
<style>
-.line-chart {
- width: 100%;
+.line-chart11 {
+ width: 600px;
height: 300px;
margin-top: 25px;
+ margin-left: 30px;
}
</style>
--
Gitblit v1.9.3