/** * @param dowCountMap * @param perDayCountMap * @param dowCategory * @param dateCategory * @param roamingTrend */ private void populateRoamerCountChart( final Map<RoamerType, Map<DayOfWeek, Double>> dowCountMap, final Map<RoamerType, Map<Long, Double>> perDayCountMap, final Set<DayOfWeek> dowCategory, final Set<Long> dateCategory, final RoamingTrend roamingTrend, final long startDate) { final List<ChartSeries> dowCountSeriesList = new ArrayList<ChartSeries>(); for (final RoamerType roamerType : dowCountMap.keySet()) { final ChartSeries series = new ChartSeries(); series.setName(roamerType.getDisplayName()); series.setData(dowCountMap.get(roamerType).values()); dowCountSeriesList.add(series); } final List<ChartSeries> perDayCountSeriesList = new ArrayList<ChartSeries>(); for (final RoamerType roamerType : perDayCountMap.keySet()) { final PerDaySeries series = new PerDaySeries(); series.setName(roamerType.getDisplayName()); series.setPointStart(startDate); series.setData(perDayCountMap.get(roamerType).values()); perDayCountSeriesList.add(series); } final RoamingTrendChart roamerCountChart = new RoamingTrendChart(); roamerCountChart.setDowCategoryList(dowCategory); // roamerCountChart.setPerDayCategoryList(dateCategory); roamerCountChart.setDowSeriesList(dowCountSeriesList); roamerCountChart.setPerDaySeriesList(perDayCountSeriesList); roamingTrend.setRoamersCountChart(roamerCountChart); }
/** * @param dayDataMap * @param count * @param tripCategory * @param dow */ private void populateRoamersCountDoW( final Map<RoamerType, Map<DayOfWeek, Double>> dayDataMap, final Double count, final Integer tripCategory, final DayOfWeek dow) { Map<DayOfWeek, Double> dayRoamerTypeMap = dayDataMap.get(RoamerType.of(tripCategory)); if (dayRoamerTypeMap == null) { dayRoamerTypeMap = new TreeMap<DayOfWeek, Double>(); dayDataMap.put(RoamerType.of(tripCategory), dayRoamerTypeMap); } final Double dayData = dayRoamerTypeMap.get(dow); if (dayData == null) { dayRoamerTypeMap.put(dow, count); } else { dayRoamerTypeMap.put(dow, count + dayData); } }
/** * @param dateDataMap * @param date * @param count * @param tripCategory */ private void populateRoamersCountPerDay( final Map<RoamerType, Map<Long, Double>> dateDataMap, final Long date, final Double count, final Integer tripCategory) { Map<Long, Double> dateRoamerTypeMap = dateDataMap.get(RoamerType.of(tripCategory)); if (dateRoamerTypeMap == null) { dateRoamerTypeMap = new TreeMap<Long, Double>(); dateDataMap.put(RoamerType.of(tripCategory), dateRoamerTypeMap); } final Double dateData = dateRoamerTypeMap.get(date); if (dateData == null) { dateRoamerTypeMap.put(date, count); } else { dateRoamerTypeMap.put(date, count + dateData); } }