// Stack coffee and tea consumption on top of each other. Figure( stackedBar(iota(3), [[5, 3, 1], [1, 2, 3]], 0.6, ["Coffee", "Tea"] ) ).legendLocation(LegendLocation.right) .title("Caffeine Consumption") .xLabel("Time of Day") .xTickLabels(iota(3), ["Morning", "Afternoon", "Evening"]) .yLabel("Beverages") .showAsMain();
Create a stacked bar plot. The usage mechanics are identical to those of the no error bar overload of groupedBar().