-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
30 lines (25 loc) · 685 Bytes
/
Copy pathtest.py
File metadata and controls
30 lines (25 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import dash
from dash import html, dcc
import plotly.express as px
import pandas as pd
# Sample data for demonstration
df = pd.DataFrame({
"Category": ["A", "B", "C", "D"],
"Value": [10, 20, 15, 30]
})
fig = px.bar(df, x="Category", y="Value", title="Sample Bar Chart")
app = dash.Dash(__name__)
app.layout = html.Div([
html.H1("Sample Dashboard"),
dcc.Graph(figure=fig),
html.Div([
html.Label("Select a category:"),
dcc.Dropdown(
options=[{"label": cat, "value": cat} for cat in df["Category"]],
value="A",
id="category-dropdown"
)
])
])
if __name__ == "__main__":
app.run_server(debug=True)