Public
Edited
May 19
Insert cell
Insert cell
Insert cell
data= FileAttachment("last_one_2020_take3.csv").csv({typed: true})
Insert cell
Plot.plot({
marginBottom: 90,
marginLeft: 60,
x: {
tickRotate: -30,
label: "Billionaire"
},
y: {
label: "↑ Amount Donated (US dollars, millions)",
transform: d => d / 1e6,
grid: true,
domain: [0, 250],
},
marks: [
Plot.text([{}], {
text: () => `Top 20 Largest Donations by Billionaires`,
frameAnchor: "top",
anchor: "middle",
dy: 0,
fontSize: 15,
fontWeight: "bold"
}),
Plot.text([{}], {
text: () => `2020 Election`,
frameAnchor: "top",
anchor: "middle",
dy: 18,
fontSize: 15,
fontWeight: "bold"
}),
Plot.ruleY([0]),
Plot.barY(data, {
x: "Billionaire",
y: "Amount Donated",
sort: { x: "y", reverse: true, limit: 20 },
fill: d => d.TechOrNot === "Technology" ? "darkgreen" : "#5dade2",
title: d => `Wealth Source: ${d["Wealth Source"]}\nIndustry: ${d.Industry}`,
tip: true
})
]
})

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