original_string: private function truncateSmallValues()
      {
          $metricColumns = array_keys($this->ordinateSeries);
          $metricColumn = $metricColumns[0];
  
          $ordinateValuesSum = 0;
          foreach ($this->ordinateSeries[$metricColumn] as $ordinateValue) {
              $ordinateValuesSum += $ordinateValue;
          }
  
          $truncatedOrdinateSeries[$metricColumn] = array();
          $truncatedAbscissaSeries = array();
          $smallValuesSum = 0;
  
          $ordinateValuesCount = count($this->ordinateSeries[$metricColumn]);
          for ($i = 0; $i < $ordinateValuesCount - 1; $i++) {
              $ordinateValue = $this->ordinateSeries[$metricColumn][$i];
              if ($ordinateValue / $ordinateValuesSum > 0.01) {
                  $truncatedOrdinateSeries[$metricColumn][] = $ordinateValue;
                  $truncatedAbscissaSeries[] = $this->abscissaSeries[$i];
              } else {
                  $smallValuesSum += $ordinateValue;
              }
          }
  
          $smallValuesSum += $this->ordinateSeries[$metricColumn][$ordinateValuesCount - 1];
          if (($smallValuesSum / $ordinateValuesSum) > 0.01) {
              $truncatedOrdinateSeries[$metricColumn][] = $smallValuesSum;
              $truncatedAbscissaSeries[] = end($this->abscissaSeries);
          }
  
          $this->ordinateSeries = $truncatedOrdinateSeries;
          $this->abscissaSeries = $truncatedAbscissaSeries;
      }
code: private function truncateSmallValues()
      {
          $metricColumns = array_keys($this->ordinateSeries);
          $metricColumn = $metricColumns[0];
  
          $ordinateValuesSum = 0;
          foreach ($this->ordinateSeries[$metricColumn] as $ordinateValue) {
              $ordinateValuesSum += $ordinateValue;
          }
  
          $truncatedOrdinateSeries[$metricColumn] = array();
          $truncatedAbscissaSeries = array();
          $smallValuesSum = 0;
  
          $ordinateValuesCount = count($this->ordinateSeries[$metricColumn]);
          for ($i = 0; $i < $ordinateValuesCount - 1; $i++) {
              $ordinateValue = $this->ordinateSeries[$metricColumn][$i];
              if ($ordinateValue / $ordinateValuesSum > 0.01) {
                  $truncatedOrdinateSeries[$metricColumn][] = $ordinateValue;
                  $truncatedAbscissaSeries[] = $this->abscissaSeries[$i];
              } else {
                  $smallValuesSum += $ordinateValue;
              }
          }
  
          $smallValuesSum += $this->ordinateSeries[$metricColumn][$ordinateValuesCount - 1];
          if (($smallValuesSum / $ordinateValuesSum) > 0.01) {
              $truncatedOrdinateSeries[$metricColumn][] = $smallValuesSum;
              $truncatedAbscissaSeries[] = end($this->abscissaSeries);
          }
  
          $this->ordinateSeries = $truncatedOrdinateSeries;
          $this->abscissaSeries = $truncatedAbscissaSeries;
      }
code_tokens: private function truncateSmallValues ( ) { $ metricColumns = array_keys ( $ this -> ordinateSeries ) ; $ metricColumn = $ metricColumns [ 0 ] ; $ ordinateValuesSum = 0 ; foreach ( $ this -> ordinateSeries [ $ metricColumn ] as $ ordinateValue ) { $ ordinateValuesSum += $ ordinateValue ; } $ truncatedOrdinateSeries [ $ metricColumn ] = array ( ) ; $ truncatedAbscissaSeries = array ( ) ; $ smallValuesSum = 0 ; $ ordinateValuesCount = count ( $ this -> ordinateSeries [ $ metricColumn ] ) ; for ( $ i = 0 ; $ i < $ ordinateValuesCount - 1 ; $ i ++ ) { $ ordinateValue = $ this -> ordinateSeries [ $ metricColumn ] [ $ i ] ; if ( $ ordinateValue / $ ordinateValuesSum > 0.01 ) { $ truncatedOrdinateSeries [ $ metricColumn ] [ ] = $ ordinateValue ; $ truncatedAbscissaSeries [ ] = $ this -> abscissaSeries [ $ i ] ; } else { $ smallValuesSum += $ ordinateValue ; } } $ smallValuesSum += $ this -> ordinateSeries [ $ metricColumn ] [ $ ordinateValuesCount - 1 ] ; if ( ( $ smallValuesSum / $ ordinateValuesSum ) > 0.01 ) { $ truncatedOrdinateSeries [ $ metricColumn ] [ ] = $ smallValuesSum ; $ truncatedAbscissaSeries [ ] = end ( $ this -> abscissaSeries ) ; } $ this -> ordinateSeries = $ truncatedOrdinateSeries ; $ this -> abscissaSeries = $ truncatedAbscissaSeries ; }
docstring: this method logic is close to Piwik's core filter_truncate.
  it uses a threshold to determine if an abscissa value should be drawn on the PIE
  discarded abscissa values are summed in the 'other' abscissa value
  
  if this process is not perform, CpChart will draw pie slices that are too small to see
docstring_tokens: this method logic is close to Piwik s core filter_truncate . it uses a threshold to determine if an abscissa value should be drawn on the PIE discarded abscissa values are summed in the other abscissa value