Browse Source

Signed-off-by: liuboyan <632697560@qq.com>
矢量图形标签错位

liuboyan 4 years ago
parent
commit
31134277ea
1 changed files with 7 additions and 16 deletions
  1. 7 16
      pages/index/home.vue

+ 7 - 16
pages/index/home.vue

@@ -21,8 +21,8 @@
 				 @click="setType(item, 1)">{{item.label}}</view>
 			</view>
 			<view class="chart-box">
-				<canvas canvas-id="chartBox1" id="chartBox1" class="chart-canvas" disable-scroll=true @touchstart="touchLine1"
-				 @touchmove="moveLine1" @touchend="touchEndLine1"></canvas>
+				<canvas canvas-id="chartBox1" id="chartBox1" class="chart-canvas" @touchstart="touchLine1"
+				 @touchmove="moveLine1" @touchend="touchEndLine1" force-use-old-canvas="true"></canvas>
 			</view>
 		</view>
 		<view class="index-data-box">
@@ -32,8 +32,8 @@
 				 @click="setType(item, 2)">{{item.label}}</view>
 			</view>
 			<view class="chart-box">
-				<canvas canvas-id="chartBox2" id="chartBox2" class="chart-canvas" disable-scroll=true @touchstart="touchLine2"
-				 @touchmove="moveLine2" @touchend="touchEndLine2"></canvas>
+				<canvas canvas-id="chartBox2" id="chartBox2" class="chart-canvas" @touchstart="touchLine2"
+				 @touchmove="moveLine2" @touchend="touchEndLine2" force-use-old-canvas="true"></canvas>
 			</view>
 		</view>
 		<u-top-tips ref="uTips"></u-top-tips>
@@ -76,7 +76,7 @@
 				});
 				return false
 			}
-			// _self = this; // 浏览器调试时需要打开,微信调试时需关闭
+			_self = this; // 浏览器调试时需要打开,微信调试时需关闭
 			this.cWidth = uni.upx2px(750) - 30;
 			this.setData(1, 'creat')
 			this.setData(2, 'creat')
@@ -242,17 +242,12 @@
 </script>
 
 <style lang="less" scoped>
-	page {
-		width: 100%;
-		height: 100%;
-	}
-
 	.container {
 		width: 100%;
-		height: 100%;
+		// height: 100%;
 		float: left;
 		background-color: #f5f5f5;
-		overflow-y: auto;
+		// overflow-y: auto;
 
 		.handle-info-box {
 			width: 100%;
@@ -390,15 +385,11 @@
 				width: 100%;
 				height: 200px;
 				float: left;
-				position: relative;
-				overflow: hidden;
 
 				.chart-canvas {
 					width: 100% !important;
 					height: 200px !important;
-					position: relative;
 					float: left;
-					overflow: hidden;
 				}
 			}
 		}