@Override
    public HashMap<String, Object> getChartData(int eventId) {
        HashMap<String, Object> result = new HashMap<String, Object>();
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("eventId", eventId);
        List<Task> tasks;
        try {
            tasks = jdbcTemplate.query(GET_TASKS_STRING,
                    parameters, new TasksRowMapper());
        } catch (Exception e) {
            return null;
        }
        if(tasks != null && tasks.size() > 0) {
            int newTasks = 0;
            int done = 0;
            int progress = 0;
            for(Task task : tasks) {
                switch (task.getStatus()) {
                    case OPEN:
                        newTasks++;
                        break;
                    case IN_PROGRESS:
                        progress++;
                        break;
                    case DONE:
                        done++;
                        break;
                }
            }
            result.put(TaskStatus.DONE.name(), done);
            result.put(TaskStatus.IN_PROGRESS.name(), progress);
            result.put(TaskStatus.OPEN.name(), newTasks);
        }
        List<Map.Entry<String, Integer>> users = jdbcTemplate.query(GET_MOST_PRODUCTIVE,
                parameters, new ProductiveRowMapper());
        Collections.sort(users, new Comparator<Map.Entry<String, Integer>>() {
            @Override
            public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
                return o2.getValue() - o1.getValue();
            }
        });
        Iterator<Map.Entry<String, Integer>> iterator = users.iterator();
        while (iterator.hasNext()) {
            if(iterator.next().getValue() == 0) {
                iterator.remove();
            }
        }
        result.put("users", users);
        return result;
    }