Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,7 +55,7 @@ def fetch_salesforce_data():
|
|
| 55 |
def generate_salesforce_bar_chart(df):
|
| 56 |
try:
|
| 57 |
plt.figure(figsize=(12, 6))
|
| 58 |
-
|
| 59 |
plt.title("Stock Distribution by Product Name")
|
| 60 |
plt.xlabel("Product Name")
|
| 61 |
plt.ylabel("Current Stocks")
|
|
@@ -69,13 +69,6 @@ def generate_salesforce_bar_chart(df):
|
|
| 69 |
print(f"Error generating bar chart: {e}")
|
| 70 |
return None
|
| 71 |
|
| 72 |
-
# Function to process the image and extract product details
|
| 73 |
-
def process_image(image, mode, entry_type, quantity):
|
| 74 |
-
extracted_text = extract_text(image)
|
| 75 |
-
if not extracted_text:
|
| 76 |
-
return "No text detected in the image.", None
|
| 77 |
-
return f"Extracted Text:\n{extracted_text}\n\nProcessing Completed.", None
|
| 78 |
-
|
| 79 |
# Function to fetch and return Salesforce data
|
| 80 |
def get_salesforce_visualization():
|
| 81 |
df = fetch_salesforce_data()
|
|
|
|
| 55 |
def generate_salesforce_bar_chart(df):
|
| 56 |
try:
|
| 57 |
plt.figure(figsize=(12, 6))
|
| 58 |
+
plt.bar(df["Product Name"], df["Current Stocks"], color='blue')
|
| 59 |
plt.title("Stock Distribution by Product Name")
|
| 60 |
plt.xlabel("Product Name")
|
| 61 |
plt.ylabel("Current Stocks")
|
|
|
|
| 69 |
print(f"Error generating bar chart: {e}")
|
| 70 |
return None
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
# Function to fetch and return Salesforce data
|
| 73 |
def get_salesforce_visualization():
|
| 74 |
df = fetch_salesforce_data()
|