code: def test_load_saved_chart(unittest):
      import dtale.views as views
  
      df = pd.DataFrame(dict(a=[1, 2, 3], b=[4, 5, 6], c=[7, 8, 9]))
      with app.test_client() as c:
          with ExitStack():
              df, _ = views.format_data(df)
              build_data_inst({c.port: df})
  
              input_data = {
                  "data_id": str(c.port),
                  "query": None,
                  "chart_type": "line",
                  "agg": "sum",
                  "x": "a",
                  "y": ["b"],
                  "yaxis": {},
                  "cpg": False,
                  "cpy": False,
                  "animate": False,
                  "trendline": False,
              }
              params = {
                  "output": (
                      "..saved-chart-div-1.style...saved-chart-1.children...prev-saved-chart-config-1.data."
                      "..saved-chart-header-1.children.."
                  ),
                  "inputs": [ts_builder("saved-chart-config-1")],
                  "state": [
                      {
                          "id": "saved-chart-config-1",
                          "property": "data",
                          "value": input_data,
                      },
                      {
                          "id": "prev-saved-chart-config-1",
                          "property": "data",
                          "value": None,
                      },
                  ],
              }
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              response = response.json["response"]
              assert (
                  response["saved-chart-div-1"]["style"]["display"]
                  == "block"
              )
  
              params["state"][1]["value"] = input_data
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              assert response.status_code == 204
  
              params["state"][0]["value"] = None
              response = c.post(
                  "/dtale/charts/_dash-update-component", json=params
              )
              response = response.json["response"]
              assert (
                  response["saved-chart-div-1"]["style"]["display"]
                  == "none"
              )
  
file_path: dtale/tests/dtale/dash/test_saved_charts.py
imports: import pandas
  import pytest
  from tests import ExitStack
  from tests.dtale import build_data_inst
  from tests.dtale.test_views import app
  from tests.dtale.dash.test_dash import ts_builder
label_desc: Use image node_id 3 for calling a global function with example usage: test_load_saved_chart(unittest) without return types