reworked loadData to calculate the number of graph lines and days