code: def plot_timeseries(ts, figure_height=500):
      traces = []
      color_list = plotly.colors.qualitative.Dark24
      for i, col in enumerate(ts.columns):
          v = ts[col]
          if v.dtype in ["int", "float", "bool"]:
              v = v.astype(float)
              color = color_list[i % len(color_list)]
              traces.append(
                  go.Scatter(
                      name=col,
                      x=v.index,
                      y=v.values.flatten(),
                      mode="lines",
                      line=dict(color=color),
                  )
              )
  
      layout = dict(
          showlegend=True,
          xaxis=dict(
              title="Time",
              type="date",
              rangeselector=dict(
                  buttons=list(
                      [
                          dict(
                              count=7,
                              label="1w",
                              step="day",
                              stepmode="backward",
                          ),
                          dict(
                              count=1,
                              label="1m",
                              step="month",
                              stepmode="backward",
                          ),
                          dict(
                              count=6,
                              label="6m",
                              step="month",
                              stepmode="backward",
                          ),
                          dict(
                              count=1,
                              label="1y",
                              step="year",
                              stepmode="backward",
                          ),
                          dict(step="all"),
                      ]
                  )
              ),
          ),
      )
      fig = make_subplots(figure=go.Figure(layout=layout))
      fig.update_yaxes(title_text="Time Series")
      for trace in traces:
          fig.add_trace(trace)
      fig.update_layout(
          height=figure_height,
          xaxis_rangeselector_font_color="white",
          xaxis_rangeselector_activecolor="#0176D3",
          xaxis_rangeselector_bgcolor="#1B96FF",
          xaxis_rangeselector_font_family="Salesforce Sans",
      )
      return dcc.Graph(figure=fig)
  
imports: import plotly
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  from dash import dash_table, dcc
  from merlion.dashboard.settings import *
label_desc: Use image node_id 2 for calling a global function with example usage: plot_timeseries(ts, figure_height) and returns: dcc