docstr: Update the chart.
  
  Parameters
  ----------
  spec : dict or altair.Chart
      The updated chart spec or an altair Chart Object.
docstr_tok: ["Update","the","chart",".","Parameters","--","--","--","--","--","spec",":","dict","or","altair.Chart","The","updated","chart","spec","or","an","altair","Chart","Object","."]
code: def update(self, spec=None):
      """
      Update the chart.
  
      Parameters
      ----------
      spec : dict or altair.Chart
          The updated chart spec or an altair Chart Object.
      """
      _spec = spec
      if self._object_is_altair_chart(spec):
          _spec = spec.to_dict()
      if _spec is not None:
          self._spec = _spec
  
imports: from typing import Any, List, Optional, Union
  from .basic import LogComponent, ErrorComponent, ArtifactsComponent, TableComponent, ImageComponent, SectionComponent, MarkdownComponent
  from .card import MetaflowCardComponent
  from .convert_to_native_type import TaskToDict, _full_classname
  from .renderer_tools import render_safely
  import uuid
label_desc: Use image node_id 2 for calling the VegaChart obj's underlying member method code with example usage: obj.update(spec) without return types