return buildChartData(datas, type);
}
public Pair<PieChart, List<PieChartDetailInfo>> buildPieChart(QueryEntity entity, AppDataGroupByField field) {
List<PieChartDetailInfo> infos = new LinkedList<PieChartDetailInfo>();
PieChart pieChart = new PieChart().setMaxSize(Integer.MAX_VALUE);
List<Item> items = new ArrayList<Item>();
List<AppDataCommand> datas = m_appDataService.queryAppDataCommandsByField(entity, field);
for (AppDataCommand data : datas) {
Pair<Integer, Item> pair = buildPieChartItem(entity.getCommand(), data, field);
Item item = pair.getValue();
PieChartDetailInfo info = new PieChartDetailInfo();
info.setId(pair.getKey()).setTitle(item.getTitle()).setRequestSum(item.getNumber());
infos.add(info);
items.add(item);
}
pieChart.setTitle(field.getName() + "访问情况");
pieChart.addItems(items);
updatePieChartDetailInfo(infos);
return new Pair<PieChart, List<PieChartDetailInfo>>(pieChart, infos);
}