List<ChartView> chartViews = project.getChartViews();
Map<String, String> views = project.getViews();
if (chartViews.isEmpty() && !views.isEmpty()) {
for (String metricName : views.keySet()) {
ChartView view=new ChartView();
view.setTitle(metricName);
view.setMetricNames(Lists.newArrayList(views.get(metricName).split(",")));
chartViews.add(view);
}
}
if (chartViews.isEmpty()) {
for (String metricName : project.findMetricNames()) {
ChartView view=new ChartView();
view.setTitle(metricName);
view.setMetricNames(Lists.newArrayList(metricName));
chartViews.add(view);
}
}
}