<%--
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
--%>

<%@ taglib uri="jstl-c" prefix="c" %>
<%@ taglib uri="jstl-fmt" prefix="fmt" %>

<%@ taglib uri="struts-html" prefix="html" %>


<%@ taglib uri="charttaglib" prefix="chart" %>

<chart:query name="reqTrends" var="historyData">
	<chart:param name="proj_id" value="-1" />
	<chart:param name="tracker_type" value="${REQUIREMENTS_TRACKER}" />
	<chart:param name="userTrackers" value="${userTrackers}" className="java.util.ArrayList" />
	<chart:param name="startDate">
		<fmt:formatDate value="${startDate}" pattern="${formatDatePattern}" />
	</chart:param>
	<chart:param name="closeDate">
		<fmt:formatDate value="${closeDate}" pattern="${formatDatePattern}" />
	</chart:param>
</chart:query>

<chart:query name="trackerTrends" var="trendData">
	<chart:param name="proj_id" value="-1" />
	<chart:param name="tracker_type" value="${REQUIREMENTS_TRACKER}" />
	<chart:param name="userTrackers" value="${userTrackers}" className="java.util.ArrayList" />
	<chart:param name="startDate">
		<fmt:formatDate value="${startDate}" pattern="${formatDatePattern}" />
	</chart:param>
	<chart:param name="closeDate">
		<fmt:formatDate value="${closeDate}" pattern="${formatDatePattern}" />
	</chart:param>
</chart:query>

<%-- Create Chart --%>
<chart:create var="chart" type="timeSeries" width="${whtd}" height="${hght}"
	legend="true" tooltips="false"
	title="Requirements with Cumulative Changes"
	yaxisLabel="Cumulative Changes" >

	<chart:dataset type="xy" value="${historyData}" dateParsingPattern="yyyy-MM-dd"
		seriesLabels="Cumulative Changes"
		categoryProperties="dtm"
		valueProperties="modifications" cumulative="true" />

	<chart:dataset type="xy" value="${trendData}"
		axisLabel="Total / Open Requirements"
		seriesLabels="Total;Open"
		categoryProperties="dtm"
		valueProperties="total_plus;open" />

	<chart:renderer index="0" series="0" paint="magenta" />
	<chart:renderer index="1" series="0" paint="blue" />
	<chart:renderer index="1" series="1" paint="red" />

	<chart:axis createIntegerTickUnits="true" index="0" dateTickUnits="true" />

	<chart:axis createIntegerTickUnits="true" index="1" dateTickUnits="true" />
</chart:create>

<%-- (See CMU/SEI-92-TR-25 document’s page 71) --%>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
	<%-- Display the Chart --%>
	<TD WIDTH="<c:out value="${chart.width}" />"
		HEIGHT="<c:out value="${chart.height}" />"><html:img alt="Chart" border="0"
		width="${chart.width}" height="${chart.height}"
		page="/writeChart?id=${chart.id}" /></TD>
</TR>
<TR>
	<TD WIDTH="<c:out value="${chart.width}" />">
		<span class="subtext">(Total and Open Requirements by date. Cumulative Changes to Requirements reported to date.)</span>
	</TD>
</TR>

<c:out value="${lineBreak}" escapeXml="false" />

<%-- Create Chart --%>
<chart:create var="chart" type="timeSeries" width="${whtd}" height="${hght}"
	legend="true" tooltips="false" title="Requirements Changes by Date"
	yaxisLabel="Requirement Changes" >

	<chart:dataset type="xy" value="${trendData}"
		seriesLabels="Total;Open;Edited;New"
		categoryProperties="dtm"
		valueProperties="total_plus;open;edited;submitted" />

	<chart:renderer series="0" paint="blue" />
	<chart:renderer series="1" paint="red" />
	<chart:renderer series="2" paint="magenta" />
	<chart:renderer series="3" paint="pink" />

	<chart:axis createIntegerTickUnits="true" index="0" dateTickUnits="true" />
</chart:create>

<%-- (See CMU/SEI-92-TR-25 document’s page 72) --%>
<TR>
	<%-- Display the Chart --%>
	<TD WIDTH="<c:out value="${chart.width}" />"
		HEIGHT="<c:out value="${chart.height}" />"><html:img alt="Chart" border="0"
		width="${chart.width}" height="${chart.height}"
		page="/writeChart?id=${chart.id}" /></TD>
</TR>
<TR>
	<TD WIDTH="<c:out value="${chart.width}" />">
		<span class="subtext">(Number of Total and Open Requirements by date. New, Edited (changed) Requirements reported to date.)</span>
	</TD>
</TR>

</TABLE>
