stacked_bar_plot = Plot.plot({
title: "Exchange Server Counts by Industry",
marginLeft: 150,
width: 900,
x: {
label: "# Exchange Servers",
grid: true
},
y: {
label: "",
grid: false,
domain: exch
.groupby('industry')
.rollup({ct: d => op.sum(d.n)})
.orderby(aq.desc('ct'))
.columnArray('industry')
},
color: {
range: ["#31739C", "#E85E26"]
},
marks: [
Plot.barX(
exch
.groupby('industry', 'supported')
.rollup({ct: d => op.sum(d.n)})
.orderby(aq.desc('supported')),
{
x: "ct",
y: "industry",
fill: "supported"
}
)
]
})