Public
Edited
Nov 10, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
portfolioData = d3.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vQiouhWBMswtPpLpCHlRjwF1y5vXWI8Q2vB5lCp0myv3OgQtVUDy8boIqMdgPy0wK7xOB2d1rLki9PO/pub?gid=0&single=true&output=csv")
Insert cell
Insert cell
Insert cell
vl.markArc().data(portfolioData)
.transform(
vl.calculate("datum.Shares*datum.Price").as("Total")
)
.encode(
vl.row().fieldT('Date'),
vl.column().fieldN('Investor'),
vl.color().fieldN('Symbol'),
vl.theta().fieldQ('Total'),
vl.tooltip(['Symbol','Price','Shares','Total'])
).render()
Insert cell
Insert cell
vl.markBar().data(portfolioData)
.transform(
vl.calculate("datum.Shares*datum.Price").as("Total")
)
.encode(
vl.x().fieldN('Investor'),
vl.y().sum('Total'),
vl.color().fieldN('Symbol'),
vl.tooltip(['Symbol','Shares','Price','Total'])
).render()
Insert cell
Insert cell
vl.markBar().data(portfolioData)
.transform(
vl.calculate("datum.Shares*datum.Price").as("Total")
)
.encode(
vl.x().fieldT('Date'),
vl.y().sum('Total'),
vl.column().fieldN('Investor')
).render()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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