# Candles with moving average (Candlestick example)

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

Candles plus a 10-day moving-average line.

- Chart type: `line` (Line)
- Collection: Candlestick · Candlestick
- Raw configuration: https://westcoast-charts.com/gallery-src/candlestick/candlestick-line.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/candlestick/candlestick-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: "Price",
      type: "candlestick",
      data: [
        {
          x: 1767571200000,
          y: [75, 79.94, 74.51, 78.57],
          volume: 401782
        },
        {
          x: 1767657600000,
          y: [78.57, 78.77, 77.38, 78.41],
          volume: 668948
        },
        {
          x: 1767744000000,
          y: [78.41, 78.7, 77.04, 78.43],
          volume: 555403
        },
        {
          x: 1767830400000,
          y: [78.43, 79.43, 74.95, 75.7],
          volume: 660685
        },
        {
          x: 1767916800000,
          y: [75.7, 78.96, 75.59, 78],
          volume: 981910
        },
        {
          x: 1768003200000,
          y: [78, 82.19, 77.23, 82.19],
          volume: 329086
        },
        {
          x: 1768089600000,
          y: [82.19, 83.75, 80.03, 80.69],
          volume: 746206
        },
        {
          x: 1768176000000,
          y: [80.69, 81.13, 79.76, 79.85],
          volume: 623065
        },
        {
          x: 1768262400000,
          y: [79.85, 81.24, 78.36, 80.48],
          volume: 290413
        },
        {
          x: 1768348800000,
          y: [80.48, 81.64, 80.33, 80.79],
          volume: 966559
        },
        {
          x: 1768435200000,
          y: [80.79, 81.72, 77.6, 78.83],
          volume: 290879
        },
        {
          x: 1768521600000,
          y: [78.83, 79.61, 76.96, 77.47],
          volume: 989833
        },
        {
          x: 1768608000000,
          y: [77.47, 78.61, 75.22, 75.92],
          volume: 806356
        },
        {
          x: 1768694400000,
          y: [75.92, 79.39, 74.61, 78.47],
          volume: 221659
        },
        {
          x: 1768780800000,
          y: [78.47, 78.56, 77.3, 78.55],
          volume: 465997
        },
        {
          x: 1768867200000,
          y: [78.55, 78.99, 77.07, 78.36],
          volume: 796153
        },
        {
          x: 1768953600000,
          y: [78.36, 78.82, 76.3, 77.49],
          volume: 869216
        },
        {
          x: 1769040000000,
          y: [77.49, 77.56, 75.84, 76.71],
          volume: 530445
        },
        {
          x: 1769126400000,
          y: [76.71, 77.4, 75.95, 76.26],
          volume: 214726
        },
        {
          x: 1769212800000,
          y: [76.26, 77.85, 73.65, 74.94],
          volume: 238362
        },
        {
          x: 1769299200000,
          y: [74.94, 75.5, 74.35, 74.75],
          volume: 997124
        },
        {
          x: 1769385600000,
          y: [74.75, 78.35, 73.66, 77.57],
          volume: 240845
        },
        {
          x: 1769472000000,
          y: [77.57, 79.52, 77.43, 78.62],
          volume: 743767
        },
        {
          x: 1769558400000,
          y: [78.62, 81.4, 78.46, 79.82],
          volume: 966609
        },
        {
          x: 1769644800000,
          y: [79.82, 83.52, 79.76, 82.16],
          volume: 726388
        },
        {
          x: 1769731200000,
          y: [82.16, 83, 81.33, 82.62],
          volume: 749619
        },
        {
          x: 1769817600000,
          y: [82.62, 87.17, 81.2, 86.27],
          volume: 241126
        },
        {
          x: 1769904000000,
          y: [86.27, 88.11, 85.44, 86.51],
          volume: 361039
        },
        {
          x: 1769990400000,
          y: [86.51, 87.98, 85.72, 85.82],
          volume: 709845
        },
        {
          x: 1770076800000,
          y: [85.82, 85.97, 84.03, 85.15],
          volume: 731820
        },
        {
          x: 1770163200000,
          y: [85.15, 85.64, 81.8, 83.34],
          volume: 536475
        },
        {
          x: 1770249600000,
          y: [83.34, 83.89, 77.16, 78.62],
          volume: 430238
        },
        {
          x: 1770336000000,
          y: [78.62, 79.83, 77.24, 78.87],
          volume: 840107
        },
        {
          x: 1770422400000,
          y: [78.87, 82.88, 77.69, 82.78],
          volume: 962243
        },
        {
          x: 1770508800000,
          y: [82.78, 86.54, 81.71, 85.54],
          volume: 541214
        },
        {
          x: 1770595200000,
          y: [85.54, 85.65, 84.8, 85.62],
          volume: 301771
        },
        {
          x: 1770681600000,
          y: [85.62, 86.75, 84.57, 86.46],
          volume: 899791
        },
        {
          x: 1770768000000,
          y: [86.46, 86.81, 83.85, 85.13],
          volume: 515428
        },
        {
          x: 1770854400000,
          y: [85.13, 88.54, 83.58, 87.3],
          volume: 425850
        },
        {
          x: 1770940800000,
          y: [87.3, 88.97, 85.81, 88.72],
          volume: 883923
        },
        {
          x: 1771027200000,
          y: [88.72, 91.01, 88.23, 90.65],
          volume: 411013
        },
        {
          x: 1771113600000,
          y: [90.65, 92.98, 90.48, 91.76],
          volume: 722657
        },
        {
          x: 1771200000000,
          y: [91.76, 92.15, 89.35, 90.91],
          volume: 934904
        },
        {
          x: 1771286400000,
          y: [90.91, 92.33, 88.82, 89.17],
          volume: 732052
        },
        {
          x: 1771372800000,
          y: [89.17, 91.23, 88.38, 91.2],
          volume: 837128
        },
        {
          x: 1771459200000,
          y: [91.2, 93.01, 90.72, 92.7],
          volume: 983358
        },
        {
          x: 1771545600000,
          y: [92.7, 94.82, 91.88, 94.25],
          volume: 414019
        },
        {
          x: 1771632000000,
          y: [94.25, 96.35, 93.73, 94.81],
          volume: 391009
        },
        {
          x: 1771718400000,
          y: [94.81, 99.07, 93.97, 97.79],
          volume: 817546
        },
        {
          x: 1771804800000,
          y: [97.79, 98.72, 93.8, 95.01],
          volume: 578717
        },
        {
          x: 1771891200000,
          y: [95.01, 96.51, 94.32, 96.19],
          volume: 543667
        },
        {
          x: 1771977600000,
          y: [96.19, 97.8, 95.66, 96.5],
          volume: 711927
        },
        {
          x: 1772064000000,
          y: [96.5, 101.93, 95.98, 101.8],
          volume: 687051
        },
        {
          x: 1772150400000,
          y: [101.8, 103.06, 100.81, 102.01],
          volume: 278834
        },
        {
          x: 1772236800000,
          y: [102.01, 102.61, 101, 102.32],
          volume: 345086
        },
        {
          x: 1772323200000,
          y: [102.32, 103.41, 102.02, 102.32],
          volume: 656613
        },
        {
          x: 1772409600000,
          y: [102.32, 104.43, 101.84, 103.36],
          volume: 384253
        },
        {
          x: 1772496000000,
          y: [103.36, 108.44, 102.81, 108.28],
          volume: 650818
        },
        {
          x: 1772582400000,
          y: [108.28, 108.84, 106.07, 107.6],
          volume: 667862
        },
        {
          x: 1772668800000,
          y: [107.6, 109.28, 106.24, 108.51],
          volume: 675078
        },
        {
          x: 1772755200000,
          y: [108.51, 109.07, 106.88, 107.64],
          volume: 449195
        },
        {
          x: 1772841600000,
          y: [107.64, 109.22, 105.83, 105.97],
          volume: 304002
        },
        {
          x: 1772928000000,
          y: [105.97, 111.15, 105.42, 110],
          volume: 440372
        },
        {
          x: 1773014400000,
          y: [110, 115.63, 108.53, 115.05],
          volume: 656998
        },
        {
          x: 1773100800000,
          y: [115.05, 115.94, 110.9, 112.03],
          volume: 765317
        },
        {
          x: 1773187200000,
          y: [112.03, 113.5, 108.46, 109.14],
          volume: 720674
        },
        {
          x: 1773273600000,
          y: [109.14, 109.39, 107, 107.3],
          volume: 584657
        },
        {
          x: 1773360000000,
          y: [107.3, 109, 107.12, 108.47],
          volume: 536030
        },
        {
          x: 1773446400000,
          y: [108.47, 110.43, 107.52, 110.15],
          volume: 528975
        },
        {
          x: 1773532800000,
          y: [110.15, 111.16, 108.8, 108.96],
          volume: 906559
        },
        {
          x: 1773619200000,
          y: [108.96, 113.29, 107.62, 112.88],
          volume: 381614
        },
        {
          x: 1773705600000,
          y: [112.88, 113.81, 108.97, 110.55],
          volume: 292270
        },
        {
          x: 1773792000000,
          y: [110.55, 113.46, 110.18, 112.99],
          volume: 202341
        },
        {
          x: 1773878400000,
          y: [112.99, 113.58, 111.56, 113.22],
          volume: 370565
        },
        {
          x: 1773964800000,
          y: [113.22, 114.38, 111.45, 112.47],
          volume: 574304
        },
        {
          x: 1774051200000,
          y: [112.47, 113.37, 110.55, 111.84],
          volume: 665882
        },
        {
          x: 1774137600000,
          y: [111.84, 112.9, 110.21, 111.04],
          volume: 969340
        },
        {
          x: 1774224000000,
          y: [111.04, 116.54, 110.34, 115.02],
          volume: 611774
        },
        {
          x: 1774310400000,
          y: [115.02, 115.05, 111.65, 112.2],
          volume: 200242
        },
        {
          x: 1774396800000,
          y: [112.2, 113.63, 111.58, 111.79],
          volume: 729163
        }
      ]
    },
    {
      name: "SMA 10",
      type: "line",
      data: [
        [1768348800000, 79.31],
        [1768435200000, 79.34],
        [1768521600000, 79.24],
        [1768608000000, 78.99],
        [1768694400000, 79.27],
        [1768780800000, 79.32],
        [1768867200000, 78.94],
        [1768953600000, 78.62],
        [1769040000000, 78.31],
        [1769126400000, 77.89],
        [1769212800000, 77.3],
        [1769299200000, 76.89],
        [1769385600000, 76.9],
        [1769472000000, 77.17],
        [1769558400000, 77.31],
        [1769644800000, 77.67],
        [1769731200000, 78.09],
        [1769817600000, 78.97],
        [1769904000000, 79.95],
        [1769990400000, 80.91],
        [1770076800000, 81.93],
        [1770163200000, 82.79],
        [1770249600000, 82.89],
        [1770336000000, 82.92],
        [1770422400000, 83.21],
        [1770508800000, 83.55],
        [1770595200000, 83.85],
        [1770681600000, 83.87],
        [1770768000000, 83.73],
        [1770854400000, 83.88],
        [1770940800000, 84.24],
        [1771027200000, 84.97],
        [1771113600000, 86.28],
        [1771200000000, 87.49],
        [1771286400000, 88.13],
        [1771372800000, 88.69],
        [1771459200000, 89.4],
        [1771545600000, 90.18],
        [1771632000000, 91.15],
        [1771718400000, 92.2],
        [1771804800000, 92.83],
        [1771891200000, 93.38],
        [1771977600000, 93.85],
        [1772064000000, 94.94],
        [1772150400000, 96.23],
        [1772236800000, 97.34],
        [1772323200000, 98.3],
        [1772409600000, 99.21],
        [1772496000000, 100.56],
        [1772582400000, 101.54],
        [1772668800000, 102.89],
        [1772755200000, 104.03],
        [1772841600000, 104.98],
        [1772928000000, 105.8],
        [1773014400000, 107.1],
        [1773100800000, 108.08],
        [1773187200000, 108.76],
        [1773273600000, 109.15],
        [1773360000000, 109.17],
        [1773446400000, 109.43],
        [1773532800000, 109.47],
        [1773619200000, 109.99],
        [1773705600000, 110.45],
        [1773792000000, 110.75],
        [1773878400000, 110.57],
        [1773964800000, 110.61],
        [1774051200000, 110.88],
        [1774137600000, 111.26],
        [1774224000000, 111.91],
        [1774310400000, 112.12],
        [1774396800000, 112.4]
      ]
    }
  ],
  stroke: {
    width: [1, 2.5]
  },
  xaxis: {
    type: "datetime"
  },
  title: {
    text: "Price with 10-day average"
  },
  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 candlestick-candlestick-line.json --out candlestick-candlestick-line.svg --with-table` (save the options above as JSON first)
