halfway through getting charts to appear with ajax