File size: 1,236 Bytes
94ab4d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from dash import Dash, html, dcc, callback, Output, Input
import pandas as pd
import plotly.express as px
from plotly.graph_objs import scatter
import plotly.graph_objects as go

df = pd.read_csv('1709913722568.csv',na_values="None")

df.insert(4,"Size",(10 * df["Amount"].abs())/100)

app = Dash(__name__)

app.layout = html.Div([
    html.H1(children='Xpence', style={'textAlign':'center'}),
    dcc.Graph(figure=px.area(df,x="Transaction Date", y="Amount")),
    dcc.Graph(figure=px.scatter(df,x="Amount", y="Card holder",color="Card holder")),
    dcc.Graph(figure=px.icicle(df,path=[px.Constant("all"), 'Approval Status', 'Card holder','Category'],color='Category',color_continuous_scale='RdBu')),
    dcc.Graph(figure=px.bar(df,x="Card holder", y="Transaction Type",color="Transaction Type")),
    dcc.Graph(figure=px.sunburst(df,path=["Transaction Type","Card holder","Approval Status"],color='Amount')),
    dcc.Graph(figure=px.parallel_categories(df,dimensions=["Card holder","Category","Branches","Departments","Approval Status","Receipt"],color="Amount")),
    dcc.Graph(figure=px.scatter(df,x="Amount", y="Merchant",color="Card holder",opacity=0.7)),

   

])

if __name__ == '__main__':
    app.run(port='8051',debug=True)