blob: 7c79c42c79dd035c4bd8a4b02852fb079bc4a979 [file] [log] [blame]
<?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,
activeProjects as active,
activeCompanies as companies
from MonthlySummary
where period >= :start and period <= :end")
->column('Month', 'period', 'string', function($value) {return asYearMonth($value);})
->column('Projects', 'projects', 'number')
->column('Active Projects', 'active', 'number')
->column('Active Companies', 'companies', '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'));
}
?>