# Line highlight (Highlight & filter example)

> WestCoast Charts 1.1.5, release, public Core release, on npm. HTML: https://westcoast-charts.com/gallery/highlight-filter/line-highlight/ · Index for agents: https://westcoast-charts.com/llms.txt

Hover a legend entry or line; the rest fade.

- Chart type: `line` (Line)
- Collection: Highlight & filter · Highlight filter
- Raw configuration: https://westcoast-charts.com/gallery-src/highlight-filter/line-highlight.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/highlight-filter/line-highlight.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
```

## Options

```js
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()
```

## Verify

- Text check (Library 1.1.5): load `west-coast-charts/agent/describe` and call `chart.describe({ format: "json" })` for the actual drawn state. The live reader is on this example’s HTML page.
- Command line (Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm, https://westcoast-charts.com/docs/cli/index.md): `wcc chart export highlight-filter-line-highlight.json --out highlight-filter-line-highlight.svg --with-table` (save the options above as JSON first)
