def METHOD_NAME(
    figure: Figure,
    stacked_bar_table: pd.DataFrame,
    alerts: Union[np.ndarray, pd.Series],
    color: str,
    chunk_start_dates: Optional[Union[np.ndarray, pd.Series]] = None,
    chunk_end_dates: Optional[Union[np.ndarray, pd.Series]] = None,
    chunk_indices: Optional[Union[np.ndarray, pd.Series]] = None,
    subplot_args: Optional[Dict[str, Any]] = None,
    annotation: Optional[str] = None,
    **kwargs,
) -> Figure:
    if chunk_start_dates is None and chunk_end_dates is None and chunk_indices is None:
        raise InvalidArgumentsException(
            "you must provide either 'chunk_indices' or 'chunk_start_dates' and " "'chunk_end_dates."
        )
    prv_color = figure.data[0].marker.line.color or figure.data[0].line.color
    marker_line_colors = [color if val else prv_color for val in list(alerts)]
    marker_line_widths = [2 if val else 0 for val in list(alerts)]
    if is_time_based_x_axis(chunk_start_dates, chunk_end_dates):
        anchor = cast(Union[np.ndarray, pd.Series], chunk_start_dates)[0]
    else:
        anchor = cast(Union[np.ndarray, pd.Series], chunk_indices)[0]
    max_x_axis = max([bar.xaxis for bar in figure.data])
    for bars in [bar for bar in figure.data if bar.x[0] == anchor and bar.xaxis == max_x_axis]:
        bars.marker.line.color = marker_line_colors
        bars.marker.line.width = marker_line_widths
    return figure