code: def add_chart(self, component):
          
          if getattr(component, "name") != "Chart":
              raise Exception("Component is not an instance of Chart")
          self.charts.append(component)
docs: Add a chart to the layout.