class TrendRepositoryImpl implements TrendRepository, Constants {

    @Override
    public List<Map<String, Object>> getTrendProgress(String assetGroup,
            String ruleId, LocalDate startDate, LocalDate endDate,
            String trendCategory) throws DataException {
        Map<String, Object> mustFilter = new HashMap<>();
        mustFilter.put(CommonUtils.convertAttributetoKeyword("ag"), assetGroup);
        if ("issuecompliance".equals(trendCategory)) {
            mustFilter.put(CommonUtils.convertAttributetoKeyword("ruleId"),
                    ruleId);
        }

        Map<String, Object> rangeMap = new HashMap<>();
        rangeMap.put("gte", startDate.format(DateTimeFormatter.ISO_DATE));
        rangeMap.put("lte", endDate.format(DateTimeFormatter.ISO_DATE));

        Map<String, Object> dateRangeMap = new HashMap<>();
        dateRangeMap.put("date", rangeMap);

        mustFilter.put(RANGE, dateRangeMap);
try{
        return elasticSearchRepository.getSortedDataFromES(AG_STATS, trendCategory,
                mustFilter, null, null, Arrays.asList("date", "total",
                        "compliant", "noncompliant", "compliance_percent"),
                null,null);
}catch(Exception e){
    throw new DataException(e);
}
    }

}