Line highlight
Hover a legend entry or line; the rest fade.
Open the chart without page chrome ↗
const options = {
chart: {
height: 380,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "line",
toolbar: {
show: false
}
},
series: [
{
name: "Lisbon",
data: [54, 57, 54, 53, 51, 49, 50, 48, 52, 55, 57, 57, 54, 52, 52, 48, 51, 50, 54, 54]
},
{
name: "Oslo",
data: [48, 49, 52, 51, 55, 51, 50, 51, 55, 57, 61, 61, 62, 60, 64, 64, 61, 62, 60, 59]
},
{
name: "Seattle",
data: [53, 53, 55, 56, 54, 54, 51, 53, 49, 52, 49, 47, 50, 50, 51, 54, 57, 54, 54, 53]
},
{
name: "Osaka",
data: [51, 50, 53, 57, 54, 58, 60, 62, 64, 64, 61, 62, 61, 59, 56, 54, 54, 56, 59, 59]
},
{
name: "Austin",
data: [52, 49, 51, 50, 47, 46, 48, 52, 51, 52, 53, 56, 53, 57, 57, 61, 63, 67, 66, 68]
},
{
name: "Porto",
data: [47, 45, 45, 48, 46, 43, 45, 49, 50, 51, 49, 46, 44, 47, 44, 40, 38, 35, 38, 41]
}
],
legend: {
onItemHover: {
highlightDataSeries: true
}
},
stroke: {
width: 2.5
},
title: {
text: "Bookings by city"
},
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: "line",
toolbar: {
show: false
}
},
series: [
{
name: "Lisbon",
data: [54, 57, 54, 53, 51, 49, 50, 48, 52, 55, 57, 57, 54, 52, 52, 48, 51, 50, 54, 54]
},
{
name: "Oslo",
data: [48, 49, 52, 51, 55, 51, 50, 51, 55, 57, 61, 61, 62, 60, 64, 64, 61, 62, 60, 59]
},
{
name: "Seattle",
data: [53, 53, 55, 56, 54, 54, 51, 53, 49, 52, 49, 47, 50, 50, 51, 54, 57, 54, 54, 53]
},
{
name: "Osaka",
data: [51, 50, 53, 57, 54, 58, 60, 62, 64, 64, 61, 62, 61, 59, 56, 54, 54, 56, 59, 59]
},
{
name: "Austin",
data: [52, 49, 51, 50, 47, 46, 48, 52, 51, 52, 53, 56, 53, 57, 57, 61, 63, 67, 66, 68]
},
{
name: "Porto",
data: [47, 45, 45, 48, 46, 43, 45, 49, 50, 51, 49, 46, 44, 47, 44, 40, 38, 35, 38, 41]
}
],
legend: {
onItemHover: {
highlightDataSeries: true
}
},
stroke: {
width: 2.5
},
title: {
text: "Bookings by city"
},
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-line-highlight.json --out highlight-filter-line-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/line-highlight/index.md …