lx 5 rokov pred
rodič
commit
48698868e0
3 zmenil súbory, kde vykonal 23 pridanie a 11 odobranie
  1. 22 9
      pages/index/index.js
  2. 0 1
      pages/index/index.wxml
  3. 1 1
      project.config.json

+ 22 - 9
pages/index/index.js

@@ -148,7 +148,6 @@ Page({
     //    console.log(res.top);
     // }).exec();
 },
-
   onLoad: function () {
     let sysinfo = wx.getSystemInfoSync(),
     windowHeight = sysinfo.windowHeight,
@@ -242,6 +241,7 @@ Page({
     if (this.data.currentTab === e.target.dataset.current) {
       return false;
     } else {
+      that.init_echarts();
       that.setData({
         currentTab: e.target.dataset.current
       })
@@ -260,7 +260,6 @@ Page({
        return Chart
      });
    },
- 
    setOption: function (Chart) {
      Chart.clear();  // 清除
      Chart.setOption(this.getOption());  //获取新数据
@@ -275,12 +274,14 @@ Page({
          left: 'center' 
        }, 
        renderAsImage: true, //支持渲染为图片模式 
-       color: ["#DF3E3E", "#1AFA29"],//图例图标颜色 
+       color: ["#DF3E3E", "#80CDF8"],//图例图标颜色 
        legend: { 
+        //  left:'right',
          show: true, 
          itemGap: 25,//每个图例间的间隔 
-         top: 30, 
-         x: 30,//水平安放位置,离容器左侧的距离  'left' 
+         top: 20, 
+         right:20,
+         x: 100,//水平安放位置,离容器左侧的距离  'left' 
          z: 100, 
          textStyle: { 
            color: '#383838'
@@ -292,7 +293,7 @@ Page({
                fontSize: 13, 
                color: 'white' 
              },
-             icon: 'roundRect'
+             icon: 'line'
            }, 
            { 
              name: '预测', 
@@ -300,7 +301,7 @@ Page({
                fontSize: 13, 
                color: 'white'
              }, 
-             icon: 'roundRect'
+             icon: 'line',
            } 
          ] 
        }, 
@@ -375,9 +376,21 @@ Page({
        series: [{
          name: '实际',
          type: 'line',
-         smooth:true,
+        //  smooth:true,
          data: [18, 36, 65, 30, 78, 40, 33],
          symbol: 'none',
+         areaStyle: {
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            {
+              offset: 0,
+              color: '#DF3E3E'
+           }, 
+           {
+              offset: 1,
+              color: '#1C1C1C'
+           }
+       ])
+      },
          itemStyle: {
            normal: {
              lineStyle: {
@@ -393,7 +406,7 @@ Page({
          itemStyle: {
            normal: {
              lineStyle: {
-               color: '#1AFA29'
+               color: '#80CDF8'
              }
            }
          }

+ 0 - 1
pages/index/index.wxml

@@ -2,7 +2,6 @@
 <!-- <view>
   <component-tag-name inner-text="Some text"></component-tag-name>
 </view> -->
-
 <navBar></navBar>
 <view class="container" style="height:{{height}}px" >
   <view class="swiper-tab">

+ 1 - 1
project.config.json

@@ -25,7 +25,7 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"useCompilerModule": true,
+		"useCompilerModule": false,
 		"userConfirmedUseCompilerModuleSwitch": false,
 		"compileHotReLoad": false,
 		"useIsolateContext": true