def METHOD_NAME(
    self, anim: Dict[str, Any], options: int | Dict[str, Any] | None = None
) -> None:
    """
    Updates the chart with a new configuration.
    """
    if not any(key in anim for key in ('config', 'data', 'style')):
        anim = {'config': anim}
    updates = {}
    for p, value in anim.items():
        if p not in self.param:
            raise ValueError(
                f'Could not update {p!r}. You must pass either a dictionary '
                'containing config, data and/or style values OR a single '
                'config dictionary. '
            )
        updates[p] = dict(getattr(self, p), **value)
    if isinstance(options, int):
        self.duration = options
    elif isinstance(options, dict):
        self.animation = options
    self.param.update(updates)