moved history chart series creation logic out of udpate function