Skip to content

Commit

Permalink
fix: nvd3 charts break on stateChange dispatch (apache#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Ritter authored and zhaoyongjie committed Nov 24, 2021
1 parent 4856e7e commit 30165c5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,9 @@ function nvd3Vis(element, props) {
applyYAxisBounds();

// Also reapply on each state change to account for enabled/disabled series
chart.dispatch.on('stateChange.applyYAxisBounds', applyYAxisBounds);
if (chart.dispatch && chart.dispatch.stateChange) {
chart.dispatch.on('stateChange.applyYAxisBounds', applyYAxisBounds);
}

// align yAxis1 and yAxis2 ticks
if (isVizTypes(['dual_line', 'line_multi'])) {
Expand Down

0 comments on commit 30165c5

Please sign in to comment.