diff --git a/src/modules/axes/Grid.js b/src/modules/axes/Grid.js index 6182cd1e2..fac3a3c1c 100644 --- a/src/modules/axes/Grid.js +++ b/src/modules/axes/Grid.js @@ -131,7 +131,7 @@ class Grid { -strokeSize - barWidthLeft - 2, -strokeSize * 2 - 2, gl.gridWidth + strokeSize + barWidthRight + barWidthLeft + 4, - gl.gridHeight + strokeSize * 2 + 4, + gl.gridHeight + strokeSize * 4 + 4, 0, '#fff' ) diff --git a/src/modules/dimensions/Dimensions.js b/src/modules/dimensions/Dimensions.js index 789a3019c..85cb80620 100644 --- a/src/modules/dimensions/Dimensions.js +++ b/src/modules/dimensions/Dimensions.js @@ -41,13 +41,21 @@ export default class Dimensions { this.lgRect = this.dimHelpers.getLegendsRect() - if ( - this.isSparkline && - (w.config.markers.discrete.length > 0 || w.config.markers.size > 0) - ) { - Object.entries(this.gridPad).forEach(([k, v]) => { - this.gridPad[k] = Math.max(v, this.w.globals.markers.largestSize / 1.5) - }) + if (this.isSparkline) { + if (w.config.markers.discrete.length > 0 || w.config.markers.size > 0) { + Object.entries(this.gridPad).forEach(([k, v]) => { + this.gridPad[k] = Math.max( + v, + this.w.globals.markers.largestSize / 1.5 + ) + }) + } + + this.gridPad.top = Math.max(w.config.stroke.width / 2, this.gridPad.top) + this.gridPad.bottom = Math.max( + w.config.stroke.width / 2, + this.gridPad.bottom + ) } if (gl.axisCharts) { @@ -95,11 +103,11 @@ export default class Dimensions { // store the labels and titles coords in global vars w.globals.yLabelsCoords.push({ width: yaxisLabelCoords[index].width, - index + index, }) w.globals.yTitleCoords.push({ width: yTitleCoords[index].width, - index + index, }) }) @@ -148,7 +156,7 @@ export default class Dimensions { if (this.isSparkline) { this.lgRect = { height: 0, - width: 0 + width: 0, } }