chart1900 = vl.markBar()
.data(data1900)
.encode(
vl.x().fieldQ("Percentage")
.axis({ title: "Population %", format: ".1%", labelExpr: "abs(datum.value) * 100 + '%'" })
.scale({domain: [-0.13, 0.13]}),
vl.y().fieldN("Age_Group")
.axis({ title: "Age Group" })
.sort({ field: "Age", order: "descending" }),
vl.color().fieldN("Gender")
)
.width(200)
.height(400)
.title("Population Pyramid 1900")