fixed some bug

This commit is contained in:
jiaming 2018-12-24 18:25:00 +08:00
parent 744b0efabb
commit be273d8906
1 changed files with 3 additions and 3 deletions

View File

@ -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))