filter the data before creating the line chart