Treemap highlight
Each store tile shows its online part inside the faded whole; switch the measure with the buttons.
Open the chart without page chrome ↗
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "treemap",
toolbar: {
show: false
}
},
series: [
{
name: "Sales",
data: [
{
x: "North 1",
y: 63,
highlight: 22
},
{
x: "North 2",
y: 49,
highlight: 32
},
{
x: "North 3",
y: 32,
highlight: 25
},
{
x: "South 1",
y: 64,
highlight: 33
},
{
x: "South 2",
y: 31,
highlight: 8
},
{
x: "South 3",
y: 68,
highlight: 38
},
{
x: "East 1",
y: 28,
highlight: 19
},
{
x: "East 2",
y: 56,
highlight: 32
},
{
x: "East 3",
y: 55,
highlight: 18
},
{
x: "West 1",
y: 40,
highlight: 21
},
{
x: "West 2",
y: 61,
highlight: 42
},
{
x: "West 3",
y: 50,
highlight: 23
},
{
x: "Central 1",
y: 35,
highlight: 24
},
{
x: "Central 2",
y: 58,
highlight: 13
},
{
x: "Central 3",
y: 90,
highlight: 62
}
]
}
],
plotOptions: {
treemap: {
distributed: true,
enableShades: false
}
},
legend: {
show: false
},
title: {
text: "Store sales, of which online"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import highlightFilter from 'west-coast-charts/features/highlight-filter'
WestCoastCharts.use(types).use(highlightFilter)
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "treemap",
toolbar: {
show: false
}
},
series: [
{
name: "Sales",
data: [
{
x: "North 1",
y: 63,
highlight: 22
},
{
x: "North 2",
y: 49,
highlight: 32
},
{
x: "North 3",
y: 32,
highlight: 25
},
{
x: "South 1",
y: 64,
highlight: 33
},
{
x: "South 2",
y: 31,
highlight: 8
},
{
x: "South 3",
y: 68,
highlight: 38
},
{
x: "East 1",
y: 28,
highlight: 19
},
{
x: "East 2",
y: 56,
highlight: 32
},
{
x: "East 3",
y: 55,
highlight: 18
},
{
x: "West 1",
y: 40,
highlight: 21
},
{
x: "West 2",
y: 61,
highlight: 42
},
{
x: "West 3",
y: 50,
highlight: 23
},
{
x: "Central 1",
y: 35,
highlight: 24
},
{
x: "Central 2",
y: 58,
highlight: 13
},
{
x: "Central 3",
y: 90,
highlight: 62
}
]
}
],
plotOptions: {
treemap: {
distributed: true,
enableShades: false
}
},
legend: {
show: false
},
title: {
text: "Store sales, of which online"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export highlight-filter-treemap-highlight.json --out highlight-filter-treemap-highlight.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/highlight-filter/treemap-highlight/index.md …