Skip to content

Scatter and bubbles ​

Groups, sizes, names and quadrants. Points with an id can be clicked and reached with the keyboard.

Code ​

ts
createChart(host, {
  type: "scatter",
  xLabel: "Shops",
  yLabel: "Visits per shop",
  legend: true,
  lines: [
    {
      at: 35
    },
    {
      value: 60
    }
  ],
  data: [
    {
      x: 5,
      y: 20,
      r: 0,
      label: "Area 1",
      group: "North"
    },
    {
      x: 42,
      y: 73,
      r: 29,
      label: "Area 2",
      group: "South"
    },
    {
      x: 19,
      y: 46,
      r: 58,
      label: "Area 3",
      group: "East"
    },
    {
      x: 56,
      y: 99,
      r: 87,
      label: "Area 4",
      group: "North"
    },
    {
      x: 33,
      y: 72,
      r: 16,
      label: "Area 5",
      group: "South"
    },
    {
      x: 10,
      y: 45,
      r: 45,
      label: "Area 6",
      group: "East"
    },
    {
      x: 47,
      y: 98,
      r: 74,
      label: "Area 7",
      group: "North"
    },
    {
      x: 24,
      y: 71,
      r: 3,
      label: "Area 8",
      group: "South"
    },
    {
      x: 61,
      y: 44,
      r: 32,
      label: "Area 9",
      group: "East"
    },
    {
      x: 38,
      y: 97,
      r: 61,
      label: "Area 10",
      group: "North"
    },
    {
      x: 15,
      y: 70,
      r: 90,
      label: "Area 11",
      group: "South"
    },
    {
      x: 52,
      y: 43,
      r: 19,
      label: "Area 12",
      group: "East"
    },
    {
      x: 29,
      y: 96,
      r: 48,
      label: "Area 13",
      group: "North"
    },
    {
      x: 6,
      y: 69,
      r: 77,
      label: "Area 14",
      group: "South"
    },
    {
      x: 43,
      y: 42,
      r: 6,
      label: "Area 15",
      group: "East"
    },
    {
      x: 20,
      y: 95,
      r: 35,
      label: "Area 16",
      group: "North"
    },
    {
      x: 57,
      y: 68,
      r: 64,
      label: "Area 17",
      group: "South"
    },
    {
      x: 34,
      y: 41,
      r: 93,
      label: "Area 18",
      group: "East"
    },
    {
      x: 11,
      y: 94,
      r: 22,
      label: "Area 19",
      group: "North"
    },
    {
      x: 48,
      y: 67,
      r: 51,
      label: "Area 20",
      group: "South"
    },
    {
      x: 25,
      y: 40,
      r: 80,
      label: "Area 21",
      group: "East"
    },
    {
      x: 62,
      y: 93,
      r: 9,
      label: "Area 22",
      group: "North"
    },
    {
      x: 39,
      y: 66,
      r: 38,
      label: "Area 23",
      group: "South"
    },
    {
      x: 16,
      y: 39,
      r: 67,
      label: "Area 24",
      group: "East"
    },
    {
      x: 53,
      y: 92,
      r: 96,
      label: "Area 25",
      group: "North"
    },
    {
      x: 30,
      y: 65,
      r: 25,
      label: "Area 26",
      group: "South"
    },
    {
      x: 7,
      y: 38,
      r: 54,
      label: "Area 27",
      group: "East"
    },
    {
      x: 44,
      y: 91,
      r: 83,
      label: "Area 28",
      group: "North"
    },
    {
      x: 21,
      y: 64,
      r: 12,
      label: "Area 29",
      group: "South"
    },
    {
      x: 58,
      y: 37,
      r: 41,
      label: "Area 30",
      group: "East"
    }
  ]
});

Every field is in the API. Change this chart in the playground.

MIT License