original_string: public function generate($dataTable)
      {
          $visualization = new Chart();
  
          if ($dataTable->getRowsCount() > 0) {
              // if addTotalRow was called in GenerateGraphHTML, add a row containing totals of
              // different metrics
              if ($this->properties['add_total_row']) {
                  $dataTable->queueFilter('AddSummaryRow', Piwik::translate('General_Total'));
              }
  
              $dataTable->applyQueuedFilters();
              $this->initChartObjectData($dataTable, $visualization);
          }
  
          return $visualization->render();
      }
code: public function generate($dataTable)
      {
          $visualization = new Chart();
  
          if ($dataTable->getRowsCount() > 0) {
              // if addTotalRow was called in GenerateGraphHTML, add a row containing totals of
              // different metrics
              if ($this->properties['add_total_row']) {
                  $dataTable->queueFilter('AddSummaryRow', Piwik::translate('General_Total'));
              }
  
              $dataTable->applyQueuedFilters();
              $this->initChartObjectData($dataTable, $visualization);
          }
  
          return $visualization->render();
      }
code_tokens: public function generate ( $ dataTable ) { $ visualization = new Chart ( ) ; if ( $ dataTable -> getRowsCount ( ) > 0 ) { // if addTotalRow was called in GenerateGraphHTML, add a row containing totals of // different metrics if ( $ this -> properties [ 'add_total_row' ] ) { $ dataTable -> queueFilter ( 'AddSummaryRow' , Piwik :: translate ( 'General_Total' ) ) ; } $ dataTable -> applyQueuedFilters ( ) ; $ this -> initChartObjectData ( $ dataTable , $ visualization ) ; } return $ visualization -> render ( ) ; }
docstring: Generates JSON graph data and returns it.
  
  @param DataTable|DataTable\Map $dataTable
  @return string
docstring_tokens: Generates JSON graph data and returns it .