Hi, i am using data from kaggle and trying to display it in two coloums. The graphs dont show. Any help would be great, i have been staring at this for a while and i cant see what im missing here? Thanks for any help.
import dash
from dash.dependencies import Input, Output, State
from dash import dcc
import plotly.express as px
from dash import html
import pandas as pd
csv_file = "amazon_books_Data.csv"
# read the file with pandas
df = pd.read_csv(csv_file)
# This calls an external stylesheet
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
# The main layout. This goes in a div
app.layout = html.Div([
html.H1("Analytics Dashboard Of Amazon Book Data (Dash Plotly)", style={"textAlign":"center"}),
html.Hr(),
html.P("Personal project using pandas, dash and plotly"),
# Every thing below this line (the call backs) will live inside this div
html.Div(id="output-div", children=[]),
])
@app.callback(Output(component_id="output-div", component_property="children"),)
def make_graphs():
df_hist = df_hist = df[df["product_title"]]
fig_hist = px.histogram(df_hist, x="product_title")
fig_hist.update_xaxes(categoryorder="total descending")
fig_strip = px.strip(df_hist, x="product_title", y="Sentiment_books")
return [
html.Div([
html.Div([dcc.Graph(figure=fig_hist)], className="six columns"),
html.Div([dcc.Graph(figure=fig_strip)], className="six columns"),
], className="row"),
]
# This runs the program
if __name__ == '__main__':
app.run_server(debug=False)