/**
  * This action handles the article repartition statistic page.
  *
  * It displays the number of article and the average of article for the
  * following periods:
  *   - hour of the day
  *   - day of the week
  *   - month
  *
  * @todo verify that the metrics used here make some sense. Especially
  *       for the average.
  */
 public function repartitionAction()
 {
     $statsDAO = FreshRSS_Factory::createStatsDAO();
     $categoryDAO = new FreshRSS_CategoryDAO();
     $feedDAO = FreshRSS_Factory::createFeedDao();
     Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js')));
     $id = Minz_Request::param('id', null);
     $this->view->categories = $categoryDAO->listCategories();
     $this->view->feed = $feedDAO->searchById($id);
     $this->view->days = $statsDAO->getDays();
     $this->view->months = $statsDAO->getMonths();
     $this->view->repartition = $statsDAO->calculateEntryRepartitionPerFeed($id);
     $this->view->repartitionHour = $statsDAO->calculateEntryRepartitionPerFeedPerHour($id);
     $this->view->averageHour = $statsDAO->calculateEntryAveragePerFeedPerHour($id);
     $this->view->repartitionDayOfWeek = $statsDAO->calculateEntryRepartitionPerFeedPerDayOfWeek($id);
     $this->view->averageDayOfWeek = $statsDAO->calculateEntryAveragePerFeedPerDayOfWeek($id);
     $this->view->repartitionMonth = $statsDAO->calculateEntryRepartitionPerFeedPerMonth($id);
     $this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id);
 }