code: def toggleDataset(self, state, dataset=None):
          
          if dataset is None and self.sender():
              dataset = unwrapVariant(self.sender().data())
          
          dataset.setVisible(state)
          self._dataChanged = True
          self.recalculate()
docs: Toggles the dataset based on the given action or dataset.
          
          :param      state | <bool>
                      dataset | <XChartDataset>