Are you using the Enterprise Edition? If so, you can use combined Graphs which can be found under
if you have only the CRE, then this feature is not available.
You could try to build/edit the var/check_mk/web/<your_user_name>/user_custom_graphs.mk file by script. (not sure if there are REST-API calls available for this.)