# Plot 1: Weekly revenue
weekly <- df |> group_by(Week) |> summarise(Revenue=sum(Amount), .groups="drop")
p1 <- ggplot(weekly, aes(Week, Revenue)) +
geom_col(fill=clr_green, alpha=0.8, width=0.75) +
geom_smooth(method="loess", se=TRUE, span=0.65,
colour=clr_red, fill=clr_red, alpha=0.15, linewidth=1.1) +
scale_x_continuous(breaks=1:19) +
scale_y_continuous(labels=label_number(prefix="₦", scale=1e-6, suffix="M"),
expand=expansion(mult=c(0,0.05))) +
labs(title="Plot 1 — Weekly Sales Revenue (Jan–May 2026)",
subtitle="₦82.1M total · LOESS trend confirms positive momentum · Week 18 = peak (₦5.86M)",
x="ISO Week", y=NULL)
# Plot 2: Revenue by category
cat_rev <- df |> group_by(Category) |>
summarise(Total=sum(Amount), .groups="drop") |>
mutate(Pct=Total/sum(Total), Category=fct_reorder(Category,Total))
p2 <- ggplot(cat_rev, aes(Total, Category, fill=Category)) +
geom_col(show.legend=FALSE, width=0.7) +
geom_text(aes(label=percent(Pct, accuracy=0.1)),
hjust=-0.12, size=3.5, colour=clr_dark, fontface="bold") +
scale_x_continuous(labels=label_number(prefix="₦", scale=1e-6, suffix="M"),
expand=expansion(mult=c(0,0.2))) +
scale_fill_brewer(palette="Greens", direction=1) +
labs(title="Plot 2 — Revenue by Product Category",
subtitle="Egg(Big) wholesale alone = 69% of total farm revenue", x=NULL, y=NULL)
# Plot 3: Top 10 customers
top_cust <- df |> group_by(Customer) |>
summarise(Revenue=sum(Amount), .groups="drop") |>
arrange(desc(Revenue)) |> slice_head(n=10) |>
mutate(Customer=fct_reorder(Customer,Revenue),
Highlight=ifelse(Revenue>=12e6,"Top 3","Others"))
p3 <- ggplot(top_cust, aes(Revenue, Customer, fill=Highlight)) +
geom_col(width=0.7) +
scale_x_continuous(labels=label_number(prefix="₦", scale=1e-6, suffix="M")) +
scale_fill_manual(values=c("Top 3"=clr_red,"Others"=clr_green), name=NULL) +
labs(title="Plot 3 — Top 10 Customers by Total Revenue",
subtitle="Red = top 3 customers contributing 48% of all revenue (concentration risk)",
x=NULL, y=NULL) + theme(legend.position="top")
# Plot 4: Quantity by egg category
egg_df <- df |> filter(Category %in% c("Egg(Big)","Egg(Medium)","Egg(Small)"))
p4 <- ggplot(egg_df, aes(Category, Qty, fill=Category)) +
geom_boxplot(outlier.colour=clr_red, outlier.alpha=0.5,
outlier.size=1.5, show.legend=FALSE, width=0.5) +
scale_fill_manual(values=c("Egg(Big)"="#a8d5b8","Egg(Medium)"="#5da88d","Egg(Small)"="#2e7d52")) +
scale_y_log10(labels=comma_format()) +
labs(title="Plot 4 — Order Quantity by Egg Category (log scale)",
subtitle="Egg(Big) spans widest range: single crates to 200-crate bulk deliveries",
x=NULL, y="Qty in Crates (log scale)")
# Plot 5: Payment by gender
pay_gen <- df |> count(Gender, Payment) |>
group_by(Gender) |> mutate(Pct=n/sum(n))
p5 <- ggplot(pay_gen, aes(Gender, Pct, fill=Payment)) +
geom_col(position="fill", width=0.5) +
geom_text(aes(label=percent(Pct,accuracy=1)),
position=position_fill(vjust=0.5),
colour="white", fontface="bold", size=4.5) +
scale_y_continuous(labels=percent_format()) +
scale_fill_manual(values=c("First Bank"=clr_blue,"First Monie wallet"=clr_amber), name="Payment") +
labs(title="Plot 5 — Payment Method by Gender",
subtitle="Male customers use First Bank at a higher rate than female customers",
x=NULL, y="Share of Transactions")
# Combine
(p1 / (p2 + p3)) / (p4 + p5) +
plot_annotation(
title="Danica Farms — Sales Analytics Dashboard · Jan–May 2026",
caption="Data: Danica Farms internal sales ledger",
theme=theme(plot.title=element_text(face="bold",size=16,colour=clr_dark,hjust=0.5),
plot.caption=element_text(colour="grey55"))
)