Black Lives Matter. Please consider donating to Black Girls Code today.

Unable to update header of html using callback of dashbootstrap

import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
from dash.dependencies import Input, Output


df = pd.read_excel(r"C:\Users\Soniak1\Desktop\glint_report_Comments_2019Dec08_polarity.xlsx")

items = [
    dbc.DropdownMenuItem("Box Plot"),
    dbc.DropdownMenuItem("VP", "Violin Plot"),
    #dbc.DropdownMenuItem("Item 3"),
]

navbar = dbc.NavbarSimple(
    children=[
        dbc.NavItem(dbc.NavLink("Go to Google", href="https://www.google.com")),
        dbc.DropdownMenu(
            nav=True,
            in_navbar=True,
            label="Learn More",
            children=[
                dbc.DropdownMenuItem("Violin Plot"),
                dbc.DropdownMenuItem("Box Plot"),
                dbc.DropdownMenuItem(divider=True),
                dbc.DropdownMenuItem("Topic Modelling"),
            ],
        ),
    ],
    brand="Sentiment Analysis",
    brand_href="#",
    sticky="top",
)

body = dbc.Container(
    [
        dbc.Row(
            [
                dbc.Col(
                    [
                        html.H2("Analysis"),
                        html.P(
                            """\
                            We use Cutting edge technology and Machine learning Model for Sentiment Analysis."""
                        ),
                        dbc.Row(
                            [
                        dbc.Button("View details", color="Secondary"),

                        dbc.DropdownMenu([dbc.DropdownMenuItem(children= "Box Plot", id ="dropdown-button1"),
                                            dbc.DropdownMenuItem(children="Violin Plot", id = "dropdown-button2")],
                                         label = "Plots", color="info", className="m-1")
                            ]
                                )
                    ],
                    md=4
                ),


                dbc.Col(
                    [
                        html.H2(id="htmltitle"),
                        dcc.Graph(
                            figure={"data": [{"x": [1, 2, 3], "y": [1, 4, 9]}]},

                        ),
                    ],
                ),
            ]
        )
    ],
    className="mt-4",
)




app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])

app.layout = html.Div([navbar, body])


# @app.callback(Output("htmltitle", "children"),
#             [Input("dropdown-button1", "children")])

@app.callback(
    Output('htmltitle', 'children'),
    [Input('dropdown-button1', 'children'),
     Input('dropdown-button2', 'children')])
def change_header(select_name):
    return select_name




if __name__ == "__main__":
    app.run_server()

I want to change my header figure in htmltitle id by selecting dropdown button but i am getting error

please let me know thanks!!

The problem is in your error message

change_header() takes 1 positional argument but 2 were given

You have a callback function that takes one argument but you have two inputs in the callback function.

@tcbegley is right. You have to add another argument within your function

def change_header(select_name)

Thanks for the suggestion 2 argument is good
for interactivity in dbc
It uses dash.callback_context to figure out which dbc.DropdownMenuItem was clicked
i added this in my code and it worked

Thanks