Skip to content

Commit

Permalink
Build and print Google Charts URL
Browse files Browse the repository at this point in the history
  • Loading branch information
jarofgreen committed Apr 3, 2011
1 parent 65620c4 commit 06859cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/WriteDayOfWeekData.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ public function write() {
$data[$item->getDateTimeAs('D')]++;
}

if (true) {
$maxCommits = max($data);
$dataArray = $labelArray = array();
foreach($data as $day=>$commits) {
$dataArray[] = intval($commits / $maxCommits * 100);
$labelArray[] = $day;
}
$url = 'http://chart.apis.google.com/chart?cht=bvg&chtt=Hour+Of+Day&chs=400x300&chxt=x&chxl=0:|'.implode('|',$labelArray).'&chd=t:'.implode(',',$dataArray);

print $url;
}

if (isset($this->configData['file']) && $this->configData['file']) {

if (!$handle = fopen($this->configData['file'], 'w')) {
Expand Down

0 comments on commit 06859cc

Please sign in to comment.