How to change the data of a chart according to the selected date?