private void createMinistrySummary ( final AbstractOrderedLayout content , final String field , final String label ) { final DataSeries dataSeries = new DataSeries ( ) ; final Series series = new Series ( ) ; final Map < String , List < GovernmentBodyAnnualOutcomeSummary > > reportByMinistry = esvApi . getGovernmentBodyReportByMinistry ( ) ; for ( final Entry < String , List < GovernmentBodyAnnualOutcomeSummary > > entry : reportByMinistry . entrySet ( ) ) { series . addSeries ( new XYseries ( ) . setLabel ( entry . getKey ( ) ) ) ; dataSeries . newSeries ( ) ; final Map < Integer , Double > annualSummaryMap = entry . getValue ( ) . stream ( ) . filter ( t -> t . getDescriptionFields ( ) . get ( field ) != null ) . collect ( Collectors . groupingBy ( GovernmentBodyAnnualOutcomeSummary :: getYear , Collectors . summingDouble ( GovernmentBodyAnnualOutcomeSummary :: getYearTotal ) ) ) ; for ( final Entry < Integer , Double > entryData : annualSummaryMap . entrySet ( ) ) { if ( entryData . getValue ( ) != null && entryData . getValue ( ) . intValue ( ) > 0 ) { dataSeries . add ( entryData . getKey ( ) + 1 + "-01-01" , entryData . getValue ( ) ) ; } } } addChart ( content , label , new DCharts ( ) . setDataSeries ( dataSeries ) . setOptions ( getChartOptions ( ) . createOptionsXYDateFloatLogYAxisLegendOutside ( series ) ) . show ( ) , true ) ; }
Creates the ministry summary .