render({
title: "Portfolio Total Value by Investor",
mark: "point",
data: { values: portfolioData },
transform: [
{ calculate: "datum.Shares * datum.Price", as: "Total Value" }
],
encoding: {
x: { field: "Investor", type: "N" , axis:{title:"Investor"}},
y: { field: "Symbol", type: "N" , axis:{title:"Symbol"}},
size: {field:"Total Value", type: "quantitative", legend:{title:"Total Value ($)"}},
color: { field: "Symbol", type: "N", legend:null},
tooltip: [
{ field: "Symbol", type: "N" },
{ field: "Price", type: "Q" },
{ field: "Shares", type: "Q" },
{ field: "Total Value", type: "Q" }
]
},
width: {step:60},
height:600
})