Merged common chart code into one function and fixed run time errors with old xml page