sarim commited on
Commit
7b3090d
·
1 Parent(s): a7f2622

update x and y label

Browse files
Files changed (1) hide show
  1. app.py +36 -4
app.py CHANGED
@@ -71,7 +71,17 @@ app.layout = html.Div(children = [
71
  )
72
  def update_graph(userName):
73
  filtered_df = df[df["Card holder"] == userName]
74
- fig = px.scatter(filtered_df,x="Amount", y="Transaction Date",color="Transaction Type",title="Transaction type and amount based on date")
 
 
 
 
 
 
 
 
 
 
75
 
76
  return fig
77
 
@@ -84,7 +94,16 @@ def update_bar_graph(userName):
84
  filtered_df = df[df["Card holder"] == userName]
85
  count_data_frame = filtered_df
86
  count_data_frame = filtered_df.groupby('Category').count().reset_index()
87
- fig = px.bar(count_data_frame,x="Category", y="Amount",color='Category',title="Category count")
 
 
 
 
 
 
 
 
 
88
  return fig
89
 
90
  @callback(
@@ -98,7 +117,16 @@ def update_area_graph(userName):
98
  filtered_df['Transaction Date'].dt.strftime("%Y-%m-%d")
99
  transaction_data_frame = filtered_df
100
  transaction_data_frame = filtered_df.groupby('Transaction Date').count().reset_index()
101
- fig = px.area(transaction_data_frame,x='Transaction Date',y='Amount',markers=True,title="Number of transaction on a single day")
 
 
 
 
 
 
 
 
 
102
  return fig
103
 
104
 
@@ -108,7 +136,11 @@ def update_area_graph(userName):
108
  )
109
  def update_histogram_graph(userName):
110
  filtered_df = df[df["Card holder"] == userName]
111
- fig=px.histogram(filtered_df,x='Approval Status',color="Approval Status",title="Approval status count")
 
 
 
 
112
  return fig
113
 
114
 
 
71
  )
72
  def update_graph(userName):
73
  filtered_df = df[df["Card holder"] == userName]
74
+ fig = px.scatter(filtered_df,
75
+ x="Amount",
76
+ y="Transaction Date",
77
+ color="Transaction Type",
78
+ title="Transaction type and amount based on date",
79
+ labels={
80
+ "Amount":"Transaction Amount",
81
+ "Transaction Date":"Transaction Date"
82
+ }
83
+
84
+ )
85
 
86
  return fig
87
 
 
94
  filtered_df = df[df["Card holder"] == userName]
95
  count_data_frame = filtered_df
96
  count_data_frame = filtered_df.groupby('Category').count().reset_index()
97
+ fig = px.bar(count_data_frame,
98
+ x="Category",
99
+ y="Amount",
100
+ color='Category',
101
+ title="Transaction Category count",
102
+ labels={
103
+ "Category":"Category count",
104
+ "Amount":"Transaction Amount"
105
+ }
106
+ )
107
  return fig
108
 
109
  @callback(
 
117
  filtered_df['Transaction Date'].dt.strftime("%Y-%m-%d")
118
  transaction_data_frame = filtered_df
119
  transaction_data_frame = filtered_df.groupby('Transaction Date').count().reset_index()
120
+ fig = px.area(transaction_data_frame,
121
+ x='Transaction Date',
122
+ y='Amount',
123
+ markers=True,
124
+ title="Number of transaction on a single day",
125
+ labels={
126
+ "Transaction Date":"Transaction Date",
127
+ "Amount":"Transaction Count"
128
+ }
129
+ )
130
  return fig
131
 
132
 
 
136
  )
137
  def update_histogram_graph(userName):
138
  filtered_df = df[df["Card holder"] == userName]
139
+ fig=px.histogram(filtered_df,
140
+ x='Approval Status',
141
+ color="Approval Status",
142
+ title="Approval status count",
143
+ )
144
  return fig
145
 
146