chart = Plot.plot({
marginTop: 40,
marginBottom: 40,
x: {axis: null,
padding: .4,},
y: {tickFormat: "s", grid: 5, tickSpacing: 50, label: "Population Size"},
color: {scheme: "Set2", legend: true},
style: {
fontFamily: "Helvetica",
fontSize: 17,
},
height:200,
width: 1100,
marks: [
Plot.barY(data, {
x: "Age Group",
y: "Population",
fill: "Age Group",
fx: "States",
tip: true,
sort: {limit: 20 },
}),
Plot.ruleY([0])
]
})