menikev commited on
Commit
f18070d
1 Parent(s): ecc5710

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -177,7 +177,8 @@ def create_top_discriminatory_domains_chart(df):
177
  # Function for Channel-wise Sentiment Over Time Chart
178
  def create_sentiment_distribution_by_channel_chart(df):
179
  sentiment_by_channel = df.groupby(['Channel', 'Sentiment']).size().reset_index(name='counts')
180
- fig = px.bar(sentiment_by_channel, x='Channel', y='counts', color='Sentiment', title="Sentiment Distribution by Channel", barmode='group')
 
181
  fig.update_layout(margin=dict(l=20, r=20, t=50, b=20), xaxis_title="Channel", yaxis_title="Counts", font=dict(size=10), title_x=0.5)
182
  return fig
183
 
 
177
  # Function for Channel-wise Sentiment Over Time Chart
178
  def create_sentiment_distribution_by_channel_chart(df):
179
  sentiment_by_channel = df.groupby(['Channel', 'Sentiment']).size().reset_index(name='counts')
180
+ color_map = {'Positive': 'blue', 'Neutral': 'lightblue', 'Negative': 'red'}
181
+ fig = px.bar(sentiment_by_channel, x='Channel', y='counts', color='Sentiment', title="Sentiment Distribution by Channel", barmode='group', color_discrete_map=color_map)
182
  fig.update_layout(margin=dict(l=20, r=20, t=50, b=20), xaxis_title="Channel", yaxis_title="Counts", font=dict(size=10), title_x=0.5)
183
  return fig
184