|  | <?php | 
|  | /******************************************************************************** | 
|  | * Copyright (c) 2018 The Eclipse Foundation | 
|  | * | 
|  | * This program and the accompanying materials are made available under the | 
|  | * terms of the Eclipse Public License v. 2.0 which is available at | 
|  | * http://www.eclipse.org/legal/epl-2.0. | 
|  | * | 
|  | * SPDX-License-Identifier: EPL-2.0 | 
|  | ********************************************************************************/ | 
|  | require_once dirname(__FILE__) . '/../charts.inc'; | 
|  |  | 
|  | function chart_project_activity($context) { | 
|  | return ChartBuilder::named('project_activity') | 
|  | ->title("Project Metrics (:startMY to :endMY)") | 
|  | ->description( | 
|  | "Overall project activity by month based on commits made against | 
|  | project repositories. This excludes the current month.") | 
|  | ->query('dashboard', " | 
|  | select | 
|  | period, | 
|  | projects | 
|  | from MonthlySummary | 
|  | where period >= :start and period <= :end") | 
|  | ->column('Month', 'period', 'string', function($value) {return asYearMonth($value);}) | 
|  | ->column('Projects', 'projects', 'number') | 
|  | ->substitute(':startMY', $context->getStart()->format('M Y')) | 
|  | ->substitute(':endMY', $context->getEnd()->format('M Y')) | 
|  | ->substitute(':start', $context->getStart()->format('Ym')) | 
|  | ->substitute(':end', $context->getEnd()->format('Ym')); | 
|  | } | 
|  | ?> |