code: def OnInsertChartDialog(self, event):
          
  
          key = self.grid.actions.cursor
  
          cell_code = self.grid.code_array(key)
  
          if cell_code is None:
              cell_code = u""
  
          chart_dialog = ChartDialog(self.grid.main_window, key, cell_code)
  
          if chart_dialog.ShowModal() == wx.ID_OK:
              code = chart_dialog.get_code()
              key = self.grid.actions.cursor
              self.grid.actions.set_code(key, code)
docs: Chart dialog event handler