From 36fbd1e5a40e319e6ac5f43d11c99ba4b66e93a3 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期三, 29 十一月 2023 16:50:16 +0800 Subject: [PATCH] 坡度分析下载修改 --- src/components/BarGraphAxisLine.vue | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/BarGraphAxisLine.vue b/src/components/BarGraphAxisLine.vue index 21bae23..c90c1e5 100644 --- a/src/components/BarGraphAxisLine.vue +++ b/src/components/BarGraphAxisLine.vue @@ -1,12 +1,6 @@ <template> - <div - class="Echarts_box" - :style="{ width: width, height: height }" - > - <div - id="myEchartsBIG" - style="width: 100%; height: 100%" - ></div> + <div class="Echarts_box" :style="{ width: width, height: height }"> + <div id="myEchartsBIG" style="width: 100%; height: 100%"></div> </div> </template> <script lang="ts" setup> @@ -38,6 +32,7 @@ props.layerData.points.forEach((e, i) => { xAxisData.value.push(returnFloat1(e.len)); }); + data = trans(props.layerData.points); seriesData.value = []; data.forEach((e) => { @@ -87,10 +82,17 @@ return result; } function initChart() { + let chart = myEcharts.init( document.getElementById("myEchartsBIG"), "purple-passion" ); + var unit = props.layerData.unit ? props.layerData.unit : ''; + var val = []; + xAxisData.value.filter(res => { + val.push((res / 1000).toFixed(3)); + }) + chart.setOption({ title: { text: "", @@ -159,8 +161,8 @@ }, xAxis: { type: "category", - data: xAxisData.value, - name: "绫筹紙m锛�", + data: val, + name: "鍗冪背", axisLabel: { //x杞存枃瀛楃殑閰嶇疆 showMinLabel: true, // 寮哄埗鏄剧ず鏈�灏忓�兼爣绛� @@ -198,7 +200,9 @@ }, yAxis: { + name:unit, type: "value", + }, series: seriesData.value, }); -- Gitblit v1.9.3