def create_cloud_dashboard_output(name_to_fig: dict) -> str:
    """
    A function which makes producing the json based string used to produce custom enDAQ Cloud report
    dashboards easy.

    :param name_to_fig: A dictionary mapping the desired names/titles of plots to a Plotly figure.
     The dictionary must have 4 elements, and the ordering DOES matter as it dictates the order
     the plots will be added to the dashboard.  This means the ordering of Python dictionaries which
     appears in Python 3.7 is crucial for using this!
    :return: The json based string which is to be given as the variable 'output' in enDAQ cloud
     custom dashboards
    """
    if not isinstance(name_to_fig, dict):
        raise TypeError(f"'name_to_fig' parameter must be a dictionary, but was given {type(name_to_fig)} instead")

    if len(name_to_fig) != 4:
        raise ValueError("The number of (key, value) pairs in 'name_to_fig' must be exactly 4, "
                         f"but {len(name_to_fig)} are given")

    return "[" + ", ".join([v.to_json()[:-1] + ', "title": "' + k + '"}' for k, v in name_to_fig.items()]) + "]"