dashboardChicago = {
const crimesBar = vl.markBar()
.data(crimes)
.title("Number of crimes by type")
.encode(
vl.x().fieldN("Primary Type"),
vl.y().count().title(null),
vl.color().fieldN("Primary Type")
).width(width/2).height(height/2)
const crimesLine = vl.markLine()
.title("Number of Crimes by Day")
.data(crimes)
.encode(
vl.x().fieldT("Date").timeUnit("datemonth").title("Date (month-date)"),
vl.y().count().title(null),
vl.color().fieldN("Primary Type").scale({
domain: ["BURGLARY", "HOMICIDE", "ROBBERY"],
range: ["#ffd100", "#ff0000", "#3567d0"]})
).width(width/2).height(height/2)
return vl.hconcat(
crimesMap, vl.vconcat( crimesBar,crimesLine))
.title({text:"Crimes in Chicago in April 2025",
fontSize: 25
})
.render()
}