Area highlight
Legend hover highlights one area.
Open the chart without page chrome ↗
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "area",
toolbar: {
show: false
}
},
series: [
{
name: "North",
data: [38, 36, 36, 38, 37, 40, 39, 41, 39, 42, 42, 40, 42, 42, 43, 45, 48, 49, 48, 50, 49, 51, 52, 54]
},
{
name: "South",
data: [43, 43, 45, 42, 42, 45, 45, 43, 44, 42, 44, 44, 44, 47, 49, 51, 53, 54, 54, 53, 52, 55, 54, 55]
},
{
name: "East",
data: [42, 45, 45, 43, 46, 47, 45, 46, 46, 48, 50, 51, 51, 54, 54, 52, 50, 48, 49, 46, 45, 44, 46, 49]
}
],
legend: {
onItemHover: {
highlightDataSeries: true
}
},
fill: {
opacity: 0.25
},
stroke: {
width: 2
},
title: {
text: "Energy use by grid zone"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "area",
toolbar: {
show: false
}
},
series: [
{
name: "North",
data: [38, 36, 36, 38, 37, 40, 39, 41, 39, 42, 42, 40, 42, 42, 43, 45, 48, 49, 48, 50, 49, 51, 52, 54]
},
{
name: "South",
data: [43, 43, 45, 42, 42, 45, 45, 43, 44, 42, 44, 44, 44, 47, 49, 51, 53, 54, 54, 53, 52, 55, 54, 55]
},
{
name: "East",
data: [42, 45, 45, 43, 46, 47, 45, 46, 46, 48, 50, 51, 51, 54, 54, 52, 50, 48, 49, 46, 45, 44, 46, 49]
}
],
legend: {
onItemHover: {
highlightDataSeries: true
}
},
fill: {
opacity: 0.25
},
stroke: {
width: 2
},
title: {
text: "Energy use by grid zone"
},
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-area-highlight.json --out highlight-filter-area-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/area-highlight/index.md …