devZenaight commited on
Commit
c79b29f
·
1 Parent(s): af4739d

chart colours

Browse files
app/DocumentGeneration/chart_generator.py CHANGED
@@ -85,8 +85,8 @@ def create_enhanced_chart_style(chart_type, data, title, business_idea):
85
  # Set modern style
86
  plt.style.use('default')
87
 
88
- # Professional color palette - Purple theme
89
- colors = ['#8B5CF6', '#A78BFA', '#C4B5FD', '#DDD6FE', '#EDE9FE', '#F3F4F6']
90
 
91
  if chart_type == "DC": # Doughnut Chart
92
  fig, ax = plt.subplots(figsize=(8, 6))
@@ -107,7 +107,7 @@ def create_enhanced_chart_style(chart_type, data, title, business_idea):
107
  legend = ax.legend(wedges, labels, title="Categories",
108
  loc="center left", bbox_to_anchor=(1, 0, 0.5, 1),
109
  fontsize=10, title_fontsize=12)
110
- legend.get_title().set_color('#8B5CF6')
111
 
112
  # Add business name watermark
113
  fig.text(0.5, 0.02, f"Generated for: {business_idea}",
@@ -160,11 +160,11 @@ def create_enhanced_chart_style(chart_type, data, title, business_idea):
160
  y_values = [item[1] for item in data]
161
 
162
  # Create line chart with enhanced styling
163
- ax.plot(x_values, y_values, color='#8B5CF6', linewidth=3, marker='o',
164
- markersize=8, markerfacecolor='white', markeredgecolor='#8B5CF6')
165
 
166
  # Fill area under line
167
- ax.fill_between(x_values, y_values, alpha=0.3, color='#C4B5FD')
168
 
169
  # Enhanced styling
170
  ax.set_title(title, fontsize=16, fontweight='bold', pad=20, color='#374151')
@@ -227,8 +227,8 @@ def create_chart_from_data(chart_info: Dict[str, Any], business_idea: str) -> by
227
  labels = [item[0] for item in data]
228
  values = [item[1] for item in data]
229
 
230
- # Professional color scheme - navy purple and gray tones
231
- colors = ['#4B0082', '#9370DB', '#DDA0DD', '#E6E6FA', '#F0F0F0'] # Navy purple to light gray
232
 
233
  # Create doughnut chart
234
  wedges, texts, autotexts = ax.pie(values, labels=labels, colors=colors[:len(values)],
@@ -249,8 +249,8 @@ def create_chart_from_data(chart_info: Dict[str, Any], business_idea: str) -> by
249
  labels = [item[0] for item in data]
250
  values = [item[1] for item in data]
251
 
252
- # Professional color scheme
253
- colors = ['#8B5CF6', '#A78BFA', '#C4B5FD', '#DDD6FE', '#EDE9FE']
254
 
255
  # Create bar chart
256
  bars = ax.bar(labels, values, color=colors[:len(values)],
@@ -282,11 +282,11 @@ def create_chart_from_data(chart_info: Dict[str, Any], business_idea: str) -> by
282
  y_values = [item[1] for item in data]
283
 
284
  # Create line chart
285
- ax.plot(x_values, y_values, color='#8B5CF6', linewidth=3, marker='o',
286
- markersize=8, markerfacecolor='white', markeredgecolor='#8B5CF6')
287
 
288
  # Fill area under line
289
- ax.fill_between(x_values, y_values, alpha=0.3, color='#C4B5FD')
290
 
291
  ax.set_title(chart_title, fontsize=14, fontweight='bold', pad=15, color='#374151')
292
  ax.set_xlabel('Time Period', fontsize=12, color='#6B7280')
@@ -304,8 +304,8 @@ def create_chart_from_data(chart_info: Dict[str, Any], business_idea: str) -> by
304
  labels = [item[0] for item in data]
305
  values = [item[1] for item in data]
306
 
307
- # Professional color scheme
308
- colors = ['#8B5CF6', '#A78BFA', '#C4B5FD', '#DDD6FE', '#EDE9FE']
309
 
310
  # Create pie chart
311
  wedges, texts, autotexts = ax.pie(values, labels=labels, colors=colors[:len(values)],
 
85
  # Set modern style
86
  plt.style.use('default')
87
 
88
+ # High contrast color palette for better visibility
89
+ colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD', '#98D8C8', '#F7DC6F', '#BB8FCE', '#85C1E9']
90
 
91
  if chart_type == "DC": # Doughnut Chart
92
  fig, ax = plt.subplots(figsize=(8, 6))
 
107
  legend = ax.legend(wedges, labels, title="Categories",
108
  loc="center left", bbox_to_anchor=(1, 0, 0.5, 1),
109
  fontsize=10, title_fontsize=12)
110
+ legend.get_title().set_color('#FF6B6B')
111
 
112
  # Add business name watermark
113
  fig.text(0.5, 0.02, f"Generated for: {business_idea}",
 
160
  y_values = [item[1] for item in data]
161
 
162
  # Create line chart with enhanced styling
163
+ ax.plot(x_values, y_values, color='#FF6B6B', linewidth=3, marker='o',
164
+ markersize=8, markerfacecolor='white', markeredgecolor='#FF6B6B')
165
 
166
  # Fill area under line
167
+ ax.fill_between(x_values, y_values, alpha=0.3, color='#4ECDC4')
168
 
169
  # Enhanced styling
170
  ax.set_title(title, fontsize=16, fontweight='bold', pad=20, color='#374151')
 
227
  labels = [item[0] for item in data]
228
  values = [item[1] for item in data]
229
 
230
+ # High contrast color scheme
231
+ colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD', '#98D8C8', '#F7DC6F', '#BB8FCE', '#85C1E9']
232
 
233
  # Create doughnut chart
234
  wedges, texts, autotexts = ax.pie(values, labels=labels, colors=colors[:len(values)],
 
249
  labels = [item[0] for item in data]
250
  values = [item[1] for item in data]
251
 
252
+ # High contrast color scheme
253
+ colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD', '#98D8C8', '#F7DC6F', '#BB8FCE', '#85C1E9']
254
 
255
  # Create bar chart
256
  bars = ax.bar(labels, values, color=colors[:len(values)],
 
282
  y_values = [item[1] for item in data]
283
 
284
  # Create line chart
285
+ ax.plot(x_values, y_values, color='#FF6B6B', linewidth=3, marker='o',
286
+ markersize=8, markerfacecolor='white', markeredgecolor='#FF6B6B')
287
 
288
  # Fill area under line
289
+ ax.fill_between(x_values, y_values, alpha=0.3, color='#4ECDC4')
290
 
291
  ax.set_title(chart_title, fontsize=14, fontweight='bold', pad=15, color='#374151')
292
  ax.set_xlabel('Time Period', fontsize=12, color='#6B7280')
 
304
  labels = [item[0] for item in data]
305
  values = [item[1] for item in data]
306
 
307
+ # High contrast color scheme
308
+ colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD', '#98D8C8', '#F7DC6F', '#BB8FCE', '#85C1E9']
309
 
310
  # Create pie chart
311
  wedges, texts, autotexts = ax.pie(values, labels=labels, colors=colors[:len(values)],