Pārlūkot izejas kodu

327曲线数据自适应

tangjunhao 5 mēneši atpakaļ
vecāks
revīzija
f0cdac92fb
2 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 2 0
      src/views/echart/echartLine.vue
  2. 5 3
      src/views/echart/scatter.vue

+ 2 - 0
src/views/echart/echartLine.vue

@@ -286,9 +286,11 @@ const selectshuju = (listcbval,listcbval2,dataheader, data) => {
     xAxis: {
       type: "value",  // 设置为 "category" 表示 x 轴为分类数据
       data: xdata.value, // x 轴数据为 X 轴数据
+      scale: true,
     },
     yAxis: {
       type: "value",  // y 轴是数值型
+      scale: true,
     },
     series: series.value,  // 使用生成的 series 数据
   });

+ 5 - 3
src/views/echart/scatter.vue

@@ -269,9 +269,11 @@ const selectshuju = (listcbval,listcbval2,dataheader, data) => {
     xAxis: {
       type: "value",  // 设置为 "category" 表示 x 轴为分类数据
       data: xdata.value, // x 轴数据为 X 轴数据
+      scale: true,  // 自动缩放
     },
     yAxis: {
       type: "value",  // y 轴是数值型
+      scale: true,
     },
     series: series.value,  // 使用生成的 series 数据
   });
@@ -282,7 +284,7 @@ const selectshuju = (listcbval,listcbval2,dataheader, data) => {
 const setOptionfunc = async () => {
   option.value = {
     title: {
-      text: "压力分布",
+      text: "",
       left: "7%",
       top: "5%",
       textStyle: {
@@ -322,7 +324,7 @@ const setOptionfunc = async () => {
       {
         type: "value",
         boundaryGap: false,
-        name: "x/c",
+        name: "",
         nameGap:30,
         nameTextStyle:{
           fontSize: 16,
@@ -348,7 +350,7 @@ const setOptionfunc = async () => {
 
     yAxis: {
       type: "value",
-      name:'cp',
+      name:' ',
       nameGap:40,
       nameTextStyle:{
         fontSize: 16,