Skip to content

Commit

Permalink
drawing issue when null values are present fixed - fixes #1042
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Jan 5, 2020
1 parent aa4f8ac commit 80de9c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ class Line {
}
}

let xDivision = w.globals.gridWidth / w.globals.dataPoints
let xDivision =
w.globals.gridWidth /
(w.globals.dataPoints - (w.config.xaxis.tickPlacement === 'on' ? 1 : 0))
let realIndex = w.globals.comboCharts ? seriesIndex[i] : i

const strokeWidth = Array.isArray(w.config.stroke.width)
Expand Down
5 changes: 4 additions & 1 deletion src/modules/DataLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,11 @@ class DataLabels {
for (let i = 0; i < elDataLabels.length; i++) {
const el = elDataLabels[i]
const coords = el.getBBox()
const elRect = this.addBackgroundToDataLabel(el, coords)
let elRect = null

if (coords.width && coords.height) {
elRect = this.addBackgroundToDataLabel(el, coords)
}
if (elRect) {
el.parentNode.insertBefore(elRect.node, el)
const background = el.getAttribute('fill')
Expand Down

0 comments on commit 80de9c8

Please sign in to comment.