private static void addAnnualSummaryData ( final DataSeries dataSeries , final Series series , final Entry < String , List < GovernmentBodyAnnualOutcomeSummary > > entry , final List < GovernmentBodyAnnualOutcomeSummary > allValues ) { series . addSeries ( new XYseries ( ) . setLabel ( entry . getKey ( ) ) . setShowLabel ( true ) ) ; dataSeries . newSeries ( ) ; final Map < Integer , List < GovernmentBodyAnnualOutcomeSummary > > map = allValues . stream ( ) . collect ( Collectors . groupingBy ( GovernmentBodyAnnualOutcomeSummary :: getYear ) ) ; for ( final Entry < Integer , List < GovernmentBodyAnnualOutcomeSummary > > data : map . entrySet ( ) ) { final List < GovernmentBodyAnnualOutcomeSummary > values = data . getValue ( ) ; final double sum = values . stream ( ) . mapToDouble ( GovernmentBodyAnnualOutcomeSummary :: getYearTotal ) . sum ( ) ; if ( sum > 0 ) { dataSeries . add ( data . getKey ( ) + FIRST_JAN_DATA_SUFFIX , ( int ) sum ) ; } } }
Adds the annual summary data .