<%--
 * 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="trackerTrends" var="trendData">
	<chart:param name="proj_id" value="-1" />
	<chart:param name="tracker_type" value="${TASK_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="Tasks by Date"
	yaxisLabel="Submitted/Edited Tasks" >

	<chart:dataset type="xy" value="${trendData}"
		seriesLabels="Submitted;Edited"
		categoryProperties="dtm"
		valueProperties="submitted;edited" />

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

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

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

<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 Tasks by date. New (Submitted) and Edited Tasks reported to date.)</span>
	</TD>
</TR>

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

</TABLE>

<chart:create var="chart" type="timeSeries" width="${whtd}" height="${hght}"
	legend="true" tooltips="false" title="Estimated and Spent Task Efforts in Hours"
	yaxisLabel="Open Estimated / Spent Hours">

	<chart:dataset type="xy" value="${trendData}"
		seriesLabels="Open Estimated Hours;Open Spent Hours"
		categoryProperties="dtm"
		valueProperties="open_estimated_hours;open_spent_hours" />

	<chart:dataset type="xy" value="${trendData}"
		axisLabel="Closed Estimated / Spent Hours"
		seriesLabels="Closed Estimated Hours;Closed Spent Hours"
		categoryProperties="dtm"
		valueProperties="closed_estimated_hours;closed_spent_hours" />

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

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

<%-- (CMU/SEI-92-TR-22 document’s page 62) --%>
<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">(Estimated and Spent Task Efforts in Hours shown by Open and Closed Tasks.)</span>
	</TD>
</TR>

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

</TABLE>
