lx 5 年之前
父節點
當前提交
3d4423b3cf
共有 3 個文件被更改,包括 24 次插入5 次删除
  1. 22 3
      pages/index/index.js
  2. 1 1
      pages/index/index.wxml
  3. 1 1
      project.config.json

+ 22 - 3
pages/index/index.js

@@ -25,12 +25,21 @@ function initChart(canvas, width, height, dpr, data) {
       text: '',
       left: 'center'
     },
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+          type: 'cross',
+          label: {
+              backgroundColor: '#6a7985'
+          }
+      }
+  },
     renderAsImage: true, //支持渲染为图片模式
     color: ["#DF3E3E", "#80CDF8"],//图例图标颜色
     legend: {
       show: true,
       itemGap: 25,//每个图例间的间隔
-      top: 30,
+      top: 5,
       x: 30,//水平安放位置,离容器左侧的距离  'left'
       z: 100,
       textStyle: {
@@ -38,8 +47,9 @@ function initChart(canvas, width, height, dpr, data) {
       },
     },
     grid: {//网格
-      // left: 30,
-      // top:100,
+      left: "3%",
+      top:"8%",
+      right:"3%",
       containLabel: true,//grid 区域是否包含坐标轴的刻度标签
     },
     xAxis: {//横坐标
@@ -542,6 +552,15 @@ Page({
          text: '', 
          left: 'center' 
        }, 
+       tooltip: {
+        trigger: 'axis',
+        axisPointer: {
+            type: 'cross',
+            label: {
+                backgroundColor: '#6a7985'
+            }
+        }
+    },
        renderAsImage: true, //支持渲染为图片模式 
        color: ["#DF3E3E", "#80CDF8"],//图例图标颜色 
        legend: { 

+ 1 - 1
pages/index/index.wxml

@@ -37,7 +37,7 @@
               <text class="textTwo">+527.4</text>
             </view>
           </view> -->
-    <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:500rpx;background:#1C1C1C" bindchange="bindChange">
+    <swiper current="{{currentTab}}" class="swiper-box" duration="300"  style="height:700rpx;background:#1C1C1C" bindchange="bindChange">
     <swiper-item catchtouchmove='catchTouchMove'>
      <view style="width:100%;height:100%">
        <ec-canvas  id="mychart-dom-line" canvas-id="mychart-line" tuData="{{ chartDatas }}" ec="{{ ec }}"></ec-canvas>

+ 1 - 1
project.config.json

@@ -20,7 +20,6 @@
 		"checkInvalidKey": true,
 		"checkSiteMap": true,
 		"uploadWithSourceMap": true,
-		"compileHotReLoad": false,
 		"babelSetting": {
 			"ignore": [],
 			"disablePlugins": [],
@@ -28,6 +27,7 @@
 		},
 		"useCompilerModule": true,
 		"userConfirmedUseCompilerModuleSwitch": false,
+		"compileHotReLoad": false,
 		"useIsolateContext": true
 	},
 	"compileType": "miniprogram",