use of com.djrapitops.plan.delivery.rendering.json.graphs.stack.StackGraph in project Plan by plan-player-analytics.
the class GraphJSONCreator method createActivityGraphJSON.
public Map<String, Object> createActivityGraphJSON(DateMap<Map<String, Integer>> activityData) {
Map.Entry<Long, Map<String, Integer>> lastActivityEntry = activityData.lastEntry();
Pie activityPie = graphs.pie().activityPie(lastActivityEntry != null ? lastActivityEntry.getValue() : Collections.emptyMap());
StackGraph activityStackGraph = graphs.stack().activityStackGraph(activityData);
return Maps.builder(String.class, Object.class).put("activity_series", activityStackGraph.getDataSets()).put("activity_labels", activityStackGraph.getLabels()).put("activity_pie_series", activityPie.getSlices()).build();
}
Aggregations