Skip to content

Commit

Permalink
Fix divide by zero issues on Trend indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 8, 2021
1 parent 31b5350 commit f07f712
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion panel/widgets/indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def _process_param_change(self, msg):
if 'value_change' in msg and msg['value_change'] == 'auto':
if len(ys) > 1:
y1, y2 = self._data.get(self.plot_y)[-2:]
msg['value_change'] = y2/y1 - 1
msg['value_change'] = 0 if y1 == 0 else (y2/y1 - 1)
else:
msg['value_change'] = 0
return msg

0 comments on commit f07f712

Please sign in to comment.