Public
Edited
May 2
Insert cell
Insert cell
data = FileAttachment("Sampled_Bank_info.csv").csv({typed: true})
Insert cell
// Load the aggregated data (you'd upload Summary_Bank_info.csv to Observable)
//const data = await FileAttachment("Summary_Bank_info.csv").csv({typed: true});

// Create the bar chart
Plot.plot({
marks: [
Plot.barY(data, {
x: "Merchant_Category",
y: "Transaction_Amount",
sort: {x: "y", reverse: true} // Sort by Mean_Transaction_Amount in descending order
}),
Plot.ruleY([0]) // Add a baseline at y=0
],
x: {
label: "Merchant Category",
tickRotate: 45 // Rotate labels if categories are long
},
y: {
label: "Mean Transaction Amount ($)"
},
marginBottom: 100 // Extra space for rotated labels
})
Insert cell
Plot.plot({
y: {grid: true},
color: {legend: true},
marks: [
Plot.rectY(data, Plot.binX({y: "count"}, {x: "flipper_length_mm", fill: "sex"})),
Plot.ruleY([0])
]
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more