From be273d8906989312042e1bd25f322ce61e1eb800 Mon Sep 17 00:00:00 2001 From: jiaming <743192023@qq.com> Date: Mon, 24 Dec 2018 18:25:00 +0800 Subject: [PATCH] fixed some bug --- src/mixins/axisMixin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mixins/axisMixin.js b/src/mixins/axisMixin.js index 683e57d..ee86dad 100644 --- a/src/mixins/axisMixin.js +++ b/src/mixins/axisMixin.js @@ -158,7 +158,7 @@ export default { const trueMinus = trueMax - trueMin - !num && trueMinus < 9 && (num = trueMinus + 1) + !num && trueMinus < 9 && (num = Math.ceil(trueMinus) + 1) !num && (num = 10) const valueGap = trueMinus / (num - 1) @@ -267,7 +267,7 @@ export default { ...getTextsWidth(ctx, [axisUnit[0] || '']), ...getTextsWidth(ctx, horizonAxisTags[1].length ? horizonAxisTags[1] : [''])) + defaultAxisLineTagGap - boundaryGap && (rightOffset += (xAxisTagsHalfWidth + 5)) + ;(!boundaryGap || horizon) && (rightOffset += (xAxisTagsHalfWidth + 5)) this.axisOffset[1] = (ay && ay.offset) || rightOffset @@ -461,7 +461,7 @@ export default { ctx.save() ctx.translate(...currentPos) - ctx.rotate(Math.PI / 4) + ctx.rotate(rotate * Math.PI / 180) } ctx.fillText(tag, ...(rotate ? [0, 0] : currentPos))