Stacked

Stacked bar chart

Desktop and mobile split

Stacked bar chart January: Desktop 186, Mobile 80; February: Desktop 305, Mobile 200; March: Desktop 237, Mobile 120; April: Desktop 73, Mobile 190; May: Desktop 209, Mobile 130; June: Desktop 214, Mobile 140. Desktop: 186 Mobile: 80 Jan Desktop: 305 Mobile: 200 Feb Desktop: 237 Mobile: 120 Mar Desktop: 73 Mobile: 190 Apr Desktop: 209 Mobile: 130 May Desktop: 214 Mobile: 140 Jun Desktop Mobile
<div style="padding: 1rem; max-width: 700px;">
  <div data-exo="card">
    <div data-exo="card-header">
      <h3 data-exo="card-title">Stacked bar chart</h3>
      <p style="margin: 0; color: var(--exo-muted-foreground); font-size: 0.875rem;">
        Desktop and mobile split
      </p>
    </div>
    <div data-exo="card-body">
      <.stacked_bar_chart
        data={[{"January", %{"Desktop" => 186, "Mobile" => 80}}, {"February", %{"Desktop" => 305, "Mobile" => 200}}, {"March", %{"Desktop" => 237, "Mobile" => 120}}, {"April", %{"Desktop" => 73, "Mobile" => 190}}, {"May", %{"Desktop" => 209, "Mobile" => 130}}, {"June", %{"Desktop" => 214, "Mobile" => 140}}]}
        colors={%{"Desktop" => "var(--exo-primary)", "Mobile" => "color-mix(in oklch, var(--exo-primary) 50%, transparent)"}}
        height={280}
        legend_keys={["Desktop", "Mobile"]}
       />
    </div>
  </div>
</div>

Stacked bar chart

Desktop and mobile split

No device data
<div style="padding: 1rem; max-width: 700px;">
  <div data-exo="card">
    <div data-exo="card-header">
      <h3 data-exo="card-title">Stacked bar chart</h3>
      <p style="margin: 0; color: var(--exo-muted-foreground); font-size: 0.875rem;">
        Desktop and mobile split
      </p>
    </div>
    <div data-exo="card-body">
      <.stacked_bar_chart
        data={[]}
        colors={%{"Desktop" => "var(--exo-primary)", "Mobile" => "color-mix(in oklch, var(--exo-primary) 50%, transparent)"}}
        empty_text="No device data"
        height={280}
        legend_keys={["Desktop", "Mobile"]}
       />
    </div>
  </div>
</div>