Indentation in chart xml and consistency with Java API

Modified code to fix indentation issues in chart xml
Made it more consistent with Java API