List<AlertMetric> alertKeys = m_alertInfo.queryLastestAlarmKey(5);
int step = m_dataExtractor.getStep();
for (Entry<String, List<String>> keyMapEntry : aggregationKeys.entrySet()) {
String chartTitle = keyMapEntry.getKey();
LineChart lineChart = new LineChart();
lineChart.setTitle(chartTitle);
lineChart.setHtmlTitle(chartTitle);
lineChart.setId(chartTitle);
lineChart.setStart(startDate);
lineChart.setStep(step * TimeHelper.ONE_MINUTE);
lineChart.setUnit(buildUnit(chartTitle));
for (String key : keyMapEntry.getValue()) {
if (dataWithOutFutures.containsKey(key)) {
Map<Long, Double> all = convertToMap(datas.get(key), startDate, 1);
Map<Long, Double> current = convertToMap(dataWithOutFutures.get(key), startDate, step);
buildLineChartTitle(productLine, lineChart, key, alertKeys);
addLastMinuteData(current, all, m_lastMinute, endDate);
convertFlowMetric(lineChart, current, buildLineTitle(key));
} else {
lineChart.add(chartTitle, buildNoneData(startDate, endDate, 1));
}
}
charts.put(chartTitle, lineChart);
}
return charts;