Stacked bars for different length

Hi,
I am trying to plot stacked bar graphs from the following data frame:

   name	  duration	label
   String3	Int64	SubStri…
1	AUS	    31	     1
2	AUS	    89	    2
3	AUS	   133	    3
4	GBR	    86	    1
5	GBR	    88	   2
6	GBR	   117	   3
7	GBR	   55	   4
8	IND	   249	   1
9	IND	   120	   2
10	USA	   63	   1
11	USA	   221	   2
12	USA	   112	   3
13	ITA	   84	   1 
14	ITA	  133	   2
15	ITA	  111.     3
16	ITA	   91	   4

I would like the x-axis labels to be the ‘name’ column and y-axis to be ‘duration’ stacked with ‘label’. I thought of using StatsPlot (stacked bar plot | [“Julia Plots Gallery”]) package as per the example given. However, in my data frame, the number of ‘labels’ are not the same for each ‘name’. So was wondering if there is a way I could plot stacked bars for the data frame given. Any help is appreciated.
Thanks

You could do:

using DataFrames, StatsPlots

countries = ("AUS","GBR","IND", "USA","ITA")
df = DataFrame(name=rand(countries,16), duration=rand(1:250,16), label=rand(1:4,16))

@df df groupedbar(:name, :duration, group=:label, ylabel="duration", bar_width=0.7, legend=:outertopright)

to get:

@df df groupedbar(:name, :duration, group=:label, ylabel="duration",
 bar_width=0.7, legend=:outertopright, bar_position=:stack)

grafik

@df df groupedbar(:label, :duration, group=:name, ylabel="duration",
 bar_width=0.7, legend=:outertopright, bar_position=:stack)

grafik