title: How to handle a callback in Dash Plot for Graph based on Specific Inputs from User in Dash Plot
body: <p>I am trying to handle a <code>callback</code> by return a simple Graph based on <code>Drop-Down</code> and <code>Date-Picker</code>  Inputs after Click Submit Button....</p>
  <p>So to explain in deep,</p>
  <h1>Example:</h1>
  <p>As for the below Image, let's imagine that this is the final result I need to be looks like:</p>
  <p><a href="https://i.stack.imgur.com/1K4rx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1K4rx.png" alt="enter image description here" /></a></p>
  <p>So Here's a simple of <code>Data-base</code> looks like I use as the Below Image:</p>
  <p><a href="https://i.stack.imgur.com/0DUsA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0DUsA.png" alt="enter image description here" /></a></p>
  <p>Ok Lets Explain In-Deep:</p>
  <p>Now I need to <code>Out-Put</code> a Simple Graph That's Shows a simple line with the values based on the below Input:</p>
  <ol>
  <li>1st <code>Drop-Down</code> contains the <code>CellName</code> values like in the <code>Database</code></li>
  <li>2nd <code>Drop-Down</code> Contains the list of specific Column Names I want to out-put in the Graph.</li>
  <li>3rd <code>Date-Picker</code> Contains all the dates which was in the <code>Date</code> Column in the previous DB Picture.</li>
  <li>Finally I want Click this button to Generate the Graph.</li>
  </ol>
  <p>So Here's My Code as the below:</p>
  <pre><code>import dash
  import dash_core_components as dcc
  import dash_html_components as html
  import pandas as pd
  from sqlalchemy import create_engine
  import datetime
  from datetime import datetime as dt
  from dash.dependencies import Input, Output
  
  # connect db
  engine = create_engine('mssql+pyodbc://WWX542337CDCD\SMARTRNO_EXPRESS/myDB?driver=SQL+Server+Native+Client+11.0')
  cursor = engine.raw_connection().cursor()
  
  start = datetime.datetime(2019, 12, 2)
  end = datetime.datetime(2019, 12, 15)
  
  external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
  
  app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
  
  gsm_kpis = pd.read_sql('SELECT * FROM [myDB].[dbo].[mnm_rotterdam_5_daily_details-20191216081027]',
                         engine)
  
  gsm_kpis_raw = pd.read_sql('SELECT Voice_SetupFailRate_2G, '
                             'Voice_DropRate_2G, Packet_SetupFailRate_2G, '
                             'OutgHandover_SuccesRate_2G, Voice_ErlHr_2G, Packet_DLMBytes_2G, Packet_ULMBytes_2G, '
                             'Availability_2G FROM [myDB].[dbo].[mnm_rotterdam_5_daily_details-20191216081027]',
                             engine)
  
  pd.set_option('display.max_columns', 500)
  pd.set_option('display.width', 1000)
  
  availble_cell = gsm_kpis['CellName'].unique()
  
  app.layout = html.Div([
      dcc.Dropdown(
          id='cell-name-xaxis-column',
          options=[{'label': i, 'value': i} for i in availble_cell],
          value='11063'
      ),
  
      dcc.Dropdown(
          id='myColumns',
          options=[{'label': col, 'value': col} for col in gsm_kpis_raw.columns],
          value='Voice_SetupFailRate_2G'
      ),
  
      dcc.DatePickerRange(
          id='my-date-picker-range',
          min_date_allowed=dt(1995, 8, 5),
          max_date_allowed=dt(2030, 9, 19),
          initial_visible_month=dt(2019, 10, 5),
          start_date=dt(2019, 10, 1),
          end_date=dt(2020, 1, 1)
      ),
      html.Div(id='output-container-date-picker-range'),
  
      html.Button('Submit', id='button'),
  
      dcc.Graph(
          style={'height': 300},
          id='my-graph'
      )
  
  ])
  
  @app.callback(
      Output('my-graph', 'figure'),
      [Input('cell-name-xaxis-column', 'value'),
       Input('myColumns', 'value')])
  
  def update_graph(xaxis_column_name, yaxis_column_name, date_value):
      dff = gsm_kpis[gsm_kpis['Date'] == date_value]
  
      return {
          'data': [dict(
              x = dff[dff['Date'] == xaxis_column_name]['Value'],
              y = dff[dff['Date'] == yaxis_column_name]['Value'],
              text = dff[dff['Date'] == yaxis_column_name]['Cell Name'],
              mode = 'line',
              line = {
                  'size': 15,
                  'opacity': 0.5
              }
          )],
      }
  
  if __name__ == '__main__':
      app.run_server(debug=True)
  </code></pre>
  <p>and this is the Error I find:</p>
  <pre><code>TypeError: update_graph() missing 1 required positional argument: 'date_value'
  </code></pre>
  <p>I think there's a problem with handeling the <code>Call-Back</code> function...</p>
  <p>Anyone Could help me how Can I handle this?</p>
  <p>I hope everything will be clear...</p>
  <p>Note: not Important to use the <code>Submit</code> button</p>