Adding chart functionality