use of com.hack23.cia.model.external.worldbank.data.impl.Country in project cia by Hack23.
the class UserRoleSystemTest method siteTestCountryRankingOverviewTest.
/**
* Site test country ranking overview test.
*
* @throws Exception
* the exception
*/
@Test
public void siteTestCountryRankingOverviewTest() throws Exception {
final WebDriver driver = getWebDriver();
assertNotNull(NO_WEBDRIVER_EXIST_FOR_BROWSER + browser, driver);
final UserPageVisit userPageVisit = new UserPageVisit(driver, browser);
userPageVisit.visitDirectPage(new PageModeMenuCommand(UserViews.COUNTRY_RANKING_VIEW_NAME, PageMode.OVERVIEW));
}
use of com.hack23.cia.model.external.worldbank.data.impl.Country in project cia by Hack23.
the class WorldIndicatorChartDataManagerImpl method createIndicatorChart.
@Override
public void createIndicatorChart(final AbstractOrderedLayout content, final List<WorldBankData> list, final ViewWorldbankIndicatorDataCountrySummary summary) {
final Map<Country, List<WorldBankData>> countryIndicatorsMap = list.stream().collect(Collectors.groupingBy(WorldBankData::getCountry, Collectors.toList()));
final Series series = new Series();
final DataSeries dataSeries = new DataSeries();
for (final Entry<Country, List<WorldBankData>> entry : countryIndicatorsMap.entrySet()) {
series.addSeries(new XYseries().setLabel(entry.getKey().getValue()));
dataSeries.newSeries();
for (final WorldBankData item : entry.getValue()) {
if (item != null && item.getYearDate() != null && item.getDataValue() != null && !item.getDataValue().isEmpty()) {
dataSeries.add(item.getYearDate() + "-01-01", Float.valueOf(item.getDataValue()));
}
}
}
addChart(content, summary.getIndicatorName(), new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsCountryLineChart(series)).show(), false);
}
Aggregations