Colour scale

Tiles coloured by change, red to green.

Chart type
Treemap treemap
Tier
Free Core
Collection
Treemap
Render
Live, site theme
View .md Agent setup
LIVE/treemap/color-scale3 of 7 in Treemap

Configuration

Raw Standalone
const options = {
  chart: {
    height: 380,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "treemap",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      data: [
        {
          x: "Lisbon",
          y: -3.5
        },
        {
          x: "Oslo",
          y: 2.1
        },
        {
          x: "Seattle",
          y: -0.8
        },
        {
          x: "Osaka",
          y: 1.3
        },
        {
          x: "Austin",
          y: 5
        },
        {
          x: "Porto",
          y: 4.5
        },
        {
          x: "Tallinn",
          y: 2.1
        },
        {
          x: "Lyon",
          y: -6.3
        },
        {
          x: "Bergen",
          y: 1
        },
        {
          x: "Denver",
          y: 0.4
        },
        {
          x: "Kyoto",
          y: -0.5
        },
        {
          x: "Malmö",
          y: 2
        }
      ]
    }
  ],
  plotOptions: {
    treemap: {
      enableShades: false,
      colorScale: {
        ranges: [
          {
            from: -20,
            to: 0,
            color: "#e11d48"
          },
          {
            from: 0.001,
            to: 20,
            color: "#0d9488"
          }
        ]
      }
    }
  },
  dataLabels: {
    formatter: (t, o) => [t, (o.value > 0 ? '+' : '') + o.value + '%']
  },
  title: {
    text: "Weekly change by city"
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

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