From 3d6d0ed9bcec2ce837b4b1237509f637b2989d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20H=C3=BClsken?= <150256186+huelsth@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:14:51 +0200 Subject: [PATCH] Create app.py --- data/app.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 data/app.py diff --git a/data/app.py b/data/app.py new file mode 100644 index 0000000000..0f35180d0a --- /dev/null +++ b/data/app.py @@ -0,0 +1,29 @@ +import dash +from dash import dcc, html +import pandas as pd +import plotly.express as px + +# Load the sales data generated from the last task +sales_data = pd.read_csv("sales_data.csv") + +# Filter the data to include only the relevant period for the analysis +relevant_sales_data = sales_data[sales_data['Date'] >= '2021-01-01'] + +# Sort the data by date +relevant_sales_data = relevant_sales_data.sort_values(by='Date') + +# Initialize the Dash app +app = dash.Dash(__name__) + +# Define the layout of the app +app.layout = html.Div(children=[ + html.H1(children='Soul Foods Sales Visualizer'), + + dcc.Graph( + id='sales-chart', + figure=px.line(relevant_sales_data, x='Date', y='Sales', title='Sales Over Time') + ) +]) + +if __name__ == '__main__': + app.run_server(debug=True)