Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. datasets: [{
  2.                                         label: '1st count',
  3.                                         backgroundColor: window.chartColors.green,
  4.                                         data: [<?php echo $this->getVotesCountArrayForCount(1); ?> ]
  5.                                     }, {
  6.                                         label: '2nd count',
  7.                                         backgroundColor: window.chartColors.yellow,
  8.                                         data: [ $this->getVotesCountArrayForCount(1); ]
  9.                                     }]
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. <?php
  17.  
  18. function getVotesCountArraforCount($count)
  19. {
  20. $votesArrayForCount = array();
  21. foreach($this->getRemainingCandidates() as $candidate)
  22. {
  23.    $votesArrayForCount[] = $this->VotesPerCandidateByCount[$candidate][$count];
  24.  
  25. }
  26.  
  27. return $votesArrayForCount;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement