From fb844fc3bfaa3ef88e83c2e0616597ca831f0fab Mon Sep 17 00:00:00 2001 From: jones2000 Date: Fri, 18 Oct 2019 23:03:25 +0800 Subject: [PATCH] ver 7205 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7205 DrawInsideHorizontal() 修正Y轴右边刻度和最低价重合 7204 小程序 DrawInsideHorizontal() 修正右边坐标轴刻度和最低价重合 --- umychart_uniapp_h5/umychart.uniapp.h5.js | 4 ++-- vuehqchart/src/jscommon/umychart.js | 4 ++-- vuehqchart/src/jscommon/umychart.vue/umychart.vue.js | 4 ++-- webhqchart.demo/jscommon/umychart.js | 4 ++-- webhqchart/umychart.js | 4 ++-- wechathqchart/umychart.wechat.3.0.js | 7 ++++--- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/umychart_uniapp_h5/umychart.uniapp.h5.js b/umychart_uniapp_h5/umychart.uniapp.h5.js index 926d340..5876b67 100644 --- a/umychart_uniapp_h5/umychart.uniapp.h5.js +++ b/umychart_uniapp_h5/umychart.uniapp.h5.js @@ -6717,8 +6717,8 @@ function AverageWidthFrame() if (y >= bottom - 2) this.Canvas.textBaseline = 'bottom'; else if (y <= top + 2) this.Canvas.textBaseline = 'top'; else this.Canvas.textBaseline = "middle"; - - var textObj={ X:right, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; + var textWidth = this.Canvas.measureText(item.Message[1]).width; + var textObj={ X:right-textWidth, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj)) this.Canvas.fillText(item.Message[1], right - 1*pixelTatio, y); } diff --git a/vuehqchart/src/jscommon/umychart.js b/vuehqchart/src/jscommon/umychart.js index 5ed84ae..053ce5f 100644 --- a/vuehqchart/src/jscommon/umychart.js +++ b/vuehqchart/src/jscommon/umychart.js @@ -3399,8 +3399,8 @@ function AverageWidthFrame() if (y >= bottom - 2) this.Canvas.textBaseline = 'bottom'; else if (y <= top + 2) this.Canvas.textBaseline = 'top'; else this.Canvas.textBaseline = "middle"; - - var textObj={ X:right, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; + var textWidth = this.Canvas.measureText(item.Message[1]).width; + var textObj={ X:right-textWidth, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj)) this.Canvas.fillText(item.Message[1], right - 1*pixelTatio, y); } diff --git a/vuehqchart/src/jscommon/umychart.vue/umychart.vue.js b/vuehqchart/src/jscommon/umychart.vue/umychart.vue.js index 1e94d15..511ec39 100644 --- a/vuehqchart/src/jscommon/umychart.vue/umychart.vue.js +++ b/vuehqchart/src/jscommon/umychart.vue/umychart.vue.js @@ -6758,8 +6758,8 @@ function AverageWidthFrame() if (y >= bottom - 2) this.Canvas.textBaseline = 'bottom'; else if (y <= top + 2) this.Canvas.textBaseline = 'top'; else this.Canvas.textBaseline = "middle"; - - var textObj={ X:right, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; + var textWidth = this.Canvas.measureText(item.Message[1]).width; + var textObj={ X:right-textWidth, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj)) this.Canvas.fillText(item.Message[1], right - 1*pixelTatio, y); } diff --git a/webhqchart.demo/jscommon/umychart.js b/webhqchart.demo/jscommon/umychart.js index 5ed84ae..053ce5f 100644 --- a/webhqchart.demo/jscommon/umychart.js +++ b/webhqchart.demo/jscommon/umychart.js @@ -3399,8 +3399,8 @@ function AverageWidthFrame() if (y >= bottom - 2) this.Canvas.textBaseline = 'bottom'; else if (y <= top + 2) this.Canvas.textBaseline = 'top'; else this.Canvas.textBaseline = "middle"; - - var textObj={ X:right, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; + var textWidth = this.Canvas.measureText(item.Message[1]).width; + var textObj={ X:right-textWidth, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj)) this.Canvas.fillText(item.Message[1], right - 1*pixelTatio, y); } diff --git a/webhqchart/umychart.js b/webhqchart/umychart.js index 5ed84ae..053ce5f 100644 --- a/webhqchart/umychart.js +++ b/webhqchart/umychart.js @@ -3399,8 +3399,8 @@ function AverageWidthFrame() if (y >= bottom - 2) this.Canvas.textBaseline = 'bottom'; else if (y <= top + 2) this.Canvas.textBaseline = 'top'; else this.Canvas.textBaseline = "middle"; - - var textObj={ X:right, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; + var textWidth = this.Canvas.measureText(item.Message[1]).width; + var textObj={ X:right-textWidth, Y:y, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ; if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj)) this.Canvas.fillText(item.Message[1], right - 1*pixelTatio, y); } diff --git a/wechathqchart/umychart.wechat.3.0.js b/wechathqchart/umychart.wechat.3.0.js index 60f3f1c..39b532b 100644 --- a/wechathqchart/umychart.wechat.3.0.js +++ b/wechathqchart/umychart.wechat.3.0.js @@ -2116,15 +2116,16 @@ function AverageWidthFrame() if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj)) this.Canvas.fillText(item.Message[0], left + 1, y); } - if (item.Message[1] != null && borderRight < 10 && this.IsShowYText[1] === true) { + if (item.Message[1] != null && borderRight < 10 && this.IsShowYText[1] === true) + { if (item.Font != null) this.Canvas.font = item.Font; this.Canvas.fillStyle = item.TextColor; this.Canvas.textAlign = "right"; if (y >= bottom - 2) this.Canvas.textBaseline = 'bottom'; else if (y <= top + 2) this.Canvas.textBaseline = 'top'; else this.Canvas.textBaseline = "middle"; - - var textObj = { X: right, Y: y, Text: { BaseLine: this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font: this.Canvas.font, Value: item.Message[1] } }; + var textWidth = this.Canvas.measureText(item.Message[1]).width; + var textObj = { X: right - textWidth, Y: y, Text: { BaseLine: this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font: this.Canvas.font, Value: item.Message[1] } }; if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj)) this.Canvas.fillText(item.Message[1], right - 1, y); } -- GitLab