# Basic slope (Slope example)

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

Satisfaction per product area, 2025 vs 2026.

Why it matters: end labels relax so they never overlap; colour by direction; hover focus

- Chart type: `slope` (Slope)
- Collection: Slope · Slope
- Raw configuration: https://westcoast-charts.com/gallery-src/slope/basic.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/slope/basic.html

## Setup

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

WestCoastCharts.use(types)
```

## Options

```js
const options = {
  chart: {
    height: 420,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "slope",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Atlas",
      data: [47, 49]
    },
    {
      name: "Beacon",
      data: [49, 42]
    },
    {
      name: "Cirrus",
      data: [55, 56]
    },
    {
      name: "Delta",
      data: [52, 44]
    },
    {
      name: "Ember",
      data: [73, 79]
    },
    {
      name: "Fjord",
      data: [60, 49]
    }
  ],
  xaxis: {
    categories: ["2025", "2026"]
  },
  plotOptions: {
    slope: {
      colorBy: "direction"
    }
  },
  title: {
    text: "Customer satisfaction score"
  },
  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 slope-basic.json --out slope-basic.svg --with-table` (save the options above as JSON first)
