# Gradient line (Line example)

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

A line whose stroke runs through a colour gradient.

- Chart type: `line` (Line)
- Collection: Line · Line
- Raw configuration: https://westcoast-charts.com/gallery-src/line/gradient-line.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/line/gradient-line.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: "Wind speed",
      data: [15.8, 18.9, 18.2, 18.4, 20, 17.8, 15.7, 14.7, 13, 14.8, 12.5, 15.8, 16.7, 13.7, 15.6, 16.5, 17, 17.6, 17.2, 17.1, 14.8, 17.1, 19.7, 21.4]
    }
  ],
  xaxis: {
    categories: ["0h", "1h", "2h", "3h", "4h", "5h", "6h", "7h", "8h", "9h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h"]
  },
  stroke: {
    width: 5,
    curve: "smooth"
  },
  fill: {
    type: "gradient",
    gradient: {
      shade: "dark",
      gradientToColors: ["#f59e0b"],
      type: "horizontal",
      stops: [0, 100]
    }
  },
  colors: ["#2563eb"],
  yaxis: {
    title: {
      text: "km/h"
    }
  },
  title: {
    text: "Wind speed over 24 hours"
  },
  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 line-gradient-line.json --out line-gradient-line.svg --with-table` (save the options above as JSON first)
