Skip to main content

Cross Tab Bar Chart

Compares values across multiple categories, creating a multi-layered bar chart. This allows for the comparison of values across multiple dimensions and the identification of patterns and trends. It is useful for analyzing data with multiple categorical variables, such as sales performance by region and product category.

Chart:


Code:

  muze
.canvas()
.columns(["Sales", "Profit"])
.rows([["Region", "Segment"]])
.layers([
{
mark: "bar",
encoding: {
color: {
value: () => {
return "#8DD3C7";
},
},
},
},
])
.config({
gridLines: {
x: {
show: false,
},
y: {
show: false,
},
},
axes: {
x: {
tickInterval: {
step: "year",
},
},
},
uniformAxisDomains: false,
})