<%--
 * 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="projectTrends" var="trendData">
	<chart:param name="proj_id" value="${proj_id}" 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="Documents by Date"
	yaxisLabel="New / Edited / Read Documents" >

	<chart:dataset type="xy" value="${trendData}"
		seriesLabels="New;Edited;Read"
		categoryProperties="dtm"
		valueProperties="new;edits;downloads" />

	<chart:dataset type="xy" value="${trendData}"
		axisLabel="Total Documents"
		seriesLabels="Total"
		categoryProperties="dtm"
		valueProperties="documents" />

	<chart:axis createIntegerTickUnits="true" index="0" dateTickUnits="true" />
	<chart:renderer series="0" paint="red" />
	<chart:renderer series="1" paint="orange" />
	<chart:renderer series="2" paint="green" />

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

	<chart:renderer index="1" series="0" paint="gray" />

</chart:create>

<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
	<TD WIDTH="<c:out value="${chart.width}" />">
		Number of Total, Edited, New and Read Documents for the whole Project by Date.
	</TD>
</TR>

<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>

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

</TABLE>
