From bdea1ee5b4106b53488306035c2471b8aa8091fc Mon Sep 17 00:00:00 2001 From: jiaming <743192023@qq.com> Date: Tue, 25 Dec 2018 10:56:05 +0800 Subject: [PATCH] optmization --- src/components/columnChart/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/columnChart/index.vue b/src/components/columnChart/index.vue index cf943b1..27a40e4 100644 --- a/src/components/columnChart/index.vue +++ b/src/components/columnChart/index.vue @@ -207,11 +207,13 @@ export default { ctx.strokeStyle = trueColumnColor ctx.setLineDash([10, 0]) - const { getRoundColumnPoint } = this + const { getRoundColumnPoint, labelAxisTag } = this ctx.lineCap = roundColumn ? 'round' : 'butt' - labelAxisTagPos.forEach(([x, y]) => { + labelAxisTagPos.forEach(([x, y], i) => { + if (!labelAxisTag[i] && labelAxisTag[i] !== 0) return + const topPoint = horizon ? [x + w, y] : [x, y - h] let columnBGPoints = [[x, y], topPoint]