stackedBar

Create a stacked bar plot. The usage mechanics are identical to those of the no error bar overload of groupedBar().

stackedBar
(
R1
R2
)
(,
R2 data
,
double width
,
string[] legendText = null
,
Color[] colors = null
)
if (
isInputRange!R1 &&
isRoR!R2
)

Examples

// 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();

Meta