{
const crimeBarChart = vl.markBar()
.data(crimes)
.title('Number of Crimes by Type')
.encode(
vl.y().count('id').title(null),
vl.x().fieldN('Primary Type').title('Primary Type'),
vl.color()
.fieldN('Primary Type')
.title('Crime Type')
.legend({ symbolType: 'circle' })
.scale({
domain: ['BURGLARY', 'HOMICIDE', 'ROBBERY'],
range: ['#FFD700', '#FF0000', '#3D72D6']})
)
.width((width/4 - 130)*2)
.height(225)
const cDayLineChart = vl.markLine()
.data(crimes)
.title('Number of Crimes by Day')
.encode(
vl.y().count().title(null),
vl.x().fieldT('Date').timeUnit("monthdate").title('Date (month-date)'),
vl.color().fieldN('Primary Type')
)
.width((width/4 - 130)*2)
.height(150)
return vl.hconcat(map_view, vl.vconcat(crimeBarChart,cDayLineChart))
.title({text:'Crimes in Chicago in April 2025', fontSize: 27, font: 'Times New Roman', fontWeight: 'bold'})
.resolve({scale: {size: 'independent'}})
.render();
}