Traffic by country

100 % stacked device split per country, one shared legend for all panels.

Chart type
Bar bar
Tier
Free Core
Collection
Trellis
Render
Live, site theme
View .md Agent setup
LIVE/trellis/traffic-by-country10 of 27 in Trellis

Configuration

Raw Standalone
const options = {
  chart: {
    height: "auto",
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "bar",
    stacked: true,
    stackType: "100%",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Mobile",
      country: "Portugal",
      data: [53, 35, 30, 29]
    },
    {
      name: "Desktop",
      country: "Portugal",
      data: [47, 35, 38, 53]
    },
    {
      name: "Tablet",
      country: "Portugal",
      data: [43, 54, 54, 16]
    },
    {
      name: "Mobile",
      country: "Spain",
      data: [32, 50, 20, 40]
    },
    {
      name: "Desktop",
      country: "Spain",
      data: [39, 36, 10, 30]
    },
    {
      name: "Tablet",
      country: "Spain",
      data: [16, 17, 57, 59]
    },
    {
      name: "Mobile",
      country: "France",
      data: [56, 44, 34, 30]
    },
    {
      name: "Desktop",
      country: "France",
      data: [19, 60, 23, 23]
    },
    {
      name: "Tablet",
      country: "France",
      data: [57, 26, 10, 60]
    },
    {
      name: "Mobile",
      country: "Italy",
      data: [42, 50, 45, 15]
    },
    {
      name: "Desktop",
      country: "Italy",
      data: [42, 29, 57, 17]
    },
    {
      name: "Tablet",
      country: "Italy",
      data: [52, 25, 35, 30]
    },
    {
      name: "Mobile",
      country: "Ireland",
      data: [21, 14, 45, 54]
    },
    {
      name: "Desktop",
      country: "Ireland",
      data: [55, 58, 29, 43]
    },
    {
      name: "Tablet",
      country: "Ireland",
      data: [11, 39, 39, 10]
    },
    {
      name: "Mobile",
      country: "Greece",
      data: [44, 40, 42, 27]
    },
    {
      name: "Desktop",
      country: "Greece",
      data: [13, 25, 38, 59]
    },
    {
      name: "Tablet",
      country: "Greece",
      data: [43, 45, 44, 55]
    }
  ],
  xaxis: {
    categories: ["Q1", "Q2", "Q3", "Q4"]
  },
  dataLabels: {
    enabled: false
  },
  trellis: {
    by: "country",
    columns: 3,
    aspectRatio: 1.7,
    legend: "shared"
  },
  title: {
    text: "Sessions by device"
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()