", unsafe_allow_html=True)
sale_price = st.number_input("Sale Price ($)", min_value=0.0)
shipping_price = st.number_input("Shipping Price ($)", min_value=0.0)
gift_wrap = st.number_input("Gift Wrap Price ($)", min_value=0.0)
with col3:
st.markdown("
💸 ", unsafe_allow_html=True)
product_cost = st.number_input("Product Cost ($)", min_value=0.0)
labor_cost = st.number_input("Labor Cost ($)", min_value=0.0)
packaging_cost = st.number_input("Packaging Cost ($)", min_value=0.0)
# Hesaplama
if st.button("Hesapla", key="calculate"):
total_revenue = sale_price + shipping_price + gift_wrap
total_cost = product_cost + labor_cost + packaging_cost
profit = total_revenue - total_cost
profit_margin = (profit / total_revenue) * 100 if total_revenue > 0 else 0
# Sonuçları göster
st.markdown("
📊 ", unsafe_allow_html=True)
st.write("Total Revenue: $", total_revenue)
st.write("Total Cost: $", total_cost)
st.write("Profit: $", profit)
st.write("Profit Margin: ", f"{profit_margin:.2f}%")
# Pasta grafiği
labels = ["Cost", "Profit"]
sizes = [total_cost, profit]
colors = ["#ff9999", "#66b3ff"]
fig1, ax1 = plt.subplots()
ax1.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%', startangle=90)
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
st.pyplot(fig1)