use of net.sourceforge.processdash.util.DataPair in project processdash by dtuma.
the class WorkflowPlanSummary method divide.
private Map<String, DataPair> divide(Map<String, DataPair> numerators, Map<String, DataPair> denominators) {
Map<String, DataPair> result = new LinkedHashMap<String, DataPair>();
for (Entry<String, DataPair> e : denominators.entrySet()) {
String phaseName = e.getKey();
DataPair denominator = e.getValue();
DataPair numerator = numerators.get(phaseName);
if (numerator == null)
continue;
DataPair ratio = new DataPair(numerator).divide(denominator);
result.put(phaseName, ratio);
}
return result;
}
use of net.sourceforge.processdash.util.DataPair in project processdash by dtuma.
the class ProcessAnalysisPage method getTimeInPhaseToDate.
@//
Chart(//
id = "phaseToDate", //
type = "pie", //
titleKey = "Plan.Time_In_Phase_Title", //
smallFmt = "hideLegend=t", format = "colorScheme=consistent\nconsistentSkip=2")
public ResultSet getTimeInPhaseToDate(ChartData chartData) {
Map<String, DataPair> time = chartData.histData.getTotalTimeInPhase();
double totalTime = time.remove(WorkflowHistDataHelper.TOTAL_PHASE_KEY).actual;
List<String> phases = new ArrayList(time.keySet());
ResultSet data = new ResultSet(phases.size(), 2);
data.setColName(0, getRes("Phase"));
data.setColName(1, getRes("Hours"));
data.setColName(2, getRes("Percent_Units"));
data.setFormat(2, "100%");
for (int row = phases.size(); row > 0; row--) {
String onePhase = phases.get(row - 1);
data.setRowName(row, onePhase);
data.setData(row, 1, num(time.get(onePhase).actual / 60));
data.setData(row, 2, num(time.get(onePhase).actual / totalTime));
}
return data;
}
Aggregations