filter out missing data, refactored code to share function between summary and by sector charts