The purpose of the visualizations is to uncover insights from the bank transaction data by highlighting key aspects like transaction amounts, types, and customer demographics. By visually representing these details, the aim is to reveal patterns in customer behavior and spot any unusual transactions. In designing the main plot, which shows transaction amounts by customer age and differentiates transaction types by color, the CRAP principles and Cairo’s Five Truths were applied. Contrast was used to easily distinguish between debit and credit transactions, making the chart clearer to interpret. Repetition in colors and styles ensures consistency across visuals, while alignment and proximity help reduce clutter and make the data easier to read. Following Cairo’s principles, the focus was on keeping the plot visually clear, accurate, and meaningful, so it effectively communicates trends and aids in understanding customer transaction patterns.
library(tidyverse)
library(plotly)
bank_data <- read.csv("bank_transactions_data.csv")
Do the following:
Make a plot. Any kind of plot will do (though it might be easiest
to work with geom_point()).
Make the plot interactive with ggplotly().
Make sure the hovering tooltip is more informative than the default.
Good luck and have fun!
# To create a scatter plot with Transaction Amount vs. Customer Age, color-coded by Transaction Type
plot <- ggplot(bank_data, aes(x = CustomerAge, y = TransactionAmount, color = TransactionType)) +
geom_point() +
labs(title = "Transaction Amount by Customer Age",
x = "Customer Age",
y = "Transaction Amount") +
theme_minimal()
# To make the plot interactive
interactive_plot <- ggplotly(plot, tooltip = c("x", "y", "color"))
interactive_plot