Skip to content

Commit

Permalink
prevent undefined for isReversed in bar chart
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Nov 8, 2019
1 parent 2090aa7 commit 59d3e89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/tooltip/Intersect.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ class Intersect {
(!w.config.tooltip.shared ||
(w.globals.isBarHorizontal && ttCtx.hasBars()))
) {
const isReversed = w.globals.isMultipleYAxis
? w.config.yaxis[seriesIndex] && w.config.yaxis[seriesIndex].reversed
: w.config.yaxis[0].reversed

if (isReversed) {
x = w.globals.gridWidth - x
}
Expand All @@ -205,10 +209,6 @@ class Intersect {
opt.paths.parentNode.getAttribute('data:realIndex')
)

const isReversed = w.globals.isMultipleYAxis
? w.config.yaxis[seriesIndex] && w.config.yaxis[seriesIndex].reversed
: w.config.yaxis[0].reversed

if (isReversed && !(w.globals.isBarHorizontal && ttCtx.hasBars())) {
y = y + barHeight - (w.globals.series[i][j] < 0 ? barHeight : 0) * 2
}
Expand Down

0 comments on commit 59d3e89

Please sign in to comment.