diff --git a/python/fbprophet/plot.py b/python/fbprophet/plot.py index f3f90c4..59b3124 100644 --- a/python/fbprophet/plot.py +++ b/python/fbprophet/plot.py @@ -823,8 +823,15 @@ def get_forecast_component_plotly_props(m, fcst, name, uncertainty=True, plot_ca mode = 'lines' if name == 'holidays': fcst = fcst[fcst[name] != 0].copy() - text = fcst.merge(m.holidays, how='left', on='ds')['holiday'] mode = 'markers' + # Combine holidays into one hover text + holiday_features, _, _ = m.make_holiday_features(fcst['ds'], m.holidays) + holiday_features.columns = holiday_features.columns.str.replace('_delim_', '', regex=False) + holiday_features.columns = holiday_features.columns.str.replace('+0', '', regex=False) + text = pd.Series(data='', index=holiday_features.index) + for holiday_feature, idxs in holiday_features.iteritems(): + text[idxs.astype(bool) & (text != '')] += '
' # Add newline if additional holiday + text[idxs.astype(bool)] += holiday_feature traces = [] traces.append(go.Scatter(