# Timeframe (Stock example)

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

Aggregate daily candles into weeks or months at runtime.

- Chart type: `stock` (Stock)
- Collection: Stock · Stock
- Raw configuration: https://westcoast-charts.com/gallery-src/stock/timeframe.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/premium/stock/timeframe.html

## Setup

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

WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
```

## Options

Shortened: the full configuration (46 kB, mostly data) is at https://westcoast-charts.com/gallery-src/stock/timeframe.js.

```js
const options = {
  chart: {
    height: 480,
    toolbar: {
      show: false
    },
    type: "stock"
  },
  series: [
    {
      name: "WCC",
      data: [
        [1704150000000, 120.13, 121.21, 118.98, 120.06, 1374199],
        [1704236400000, 119.73, 120.05, 118.13, 118.97, 2752929],
        [1704322800000, 118.46, 119.68, 117.53, 119.65, 2988505],
        [1704409200000, 119.53, 119.9, 118.94, 119.35, 2584628],
        [1704668400000, 119.7, 120.77, 118.69, 120.64, 2456490],
        [1704754800000, 120.7, 121.46, 120.44, 121.37, 2111057],
        [1704841200000, 121.35, 121.99, 120.15, 120.84, 2086582],
        [1704927600000, 120.67, 121.08, 119.75, 120.26, 1502292],
        [1705014000000, 119.97, 121.86, 119.52, 120.75, 1986434],
        [1705273200000, 120.65, 121.47, 120.22, 120.55, 1839892],
        [1705359600000, 120.2, 121.59, 119.29, 121.58, 2994449],
        [1705446000000, 121.99, 123.39, 121.06, 122.21, 2697182],
        [1705532400000, 122.3, 122.97, 121.67, 122.15, 1328961],
        [1705618800000, 121.74, 122.74, 121.11, 121.72, 1901166],
        [1705878000000, 122.17, 123.7, 121, 122.91, 2889506],
        [1705964400000, 123.07, 123.79, 121.91, 123.68, 2630586],
        [1706050800000, 123.87, 124.79, 122.9, 123.57, 1450767],
        [1706137200000, 123.8, 124.5, 122.36, 123.36, 1219047],
        [1706223600000, 122.98, 124.02, 122.85, 123.52, 1952802],
        [1706482800000, 123.43, 124.63, 123.27, 124.17, 1333377],
        [1706569200000, 123.96, 125.21, 123.61, 125.18, 1895718],
        [1706655600000, 125.6, 126.34, 124.13, 125.2, 2567031],
        [1706742000000, 125.31, 126.35, 124.68, 125.71, 2129136],
        [1706828400000, 125.41, 126.93, 124.97, 125.72, 1712317],
        [1707087600000, 125.68, 126.36, 125.1, 125.27, 1667028],
        [1707174000000, 124.94, 125.89, 124.42, 125.71, 2029049],
        [1707260400000, 125.39, 126.87, 124.27, 125.82, 1445693],
        [1707346800000, 125.53, 125.78, 123.93, 124.57, 2889882],
        [1707433200000, 124.18, 124.73, 123.88, 123.93, 2725815],
        [1707692400000, 124.4, 124.94, 123.14, 124.26, 1053501],
        [1707778800000, 124.13, 124.2, 123.31, 123.39, 1561702],
        [1707865200000, 123.25, 124.26, 122.34, 122.89, 1567657],
        [1707951600000, 123.08, 124.64, 122.52, 123.57, 2207181],
        [1708038000000, 123.33, 124.15, 122.16, 123.42, 1708008],
        [1708297200000, 123.17, 124, 122.23, 123.05, 1526014],
        [1708383600000, 122.6, 123.92, 121.53, 123.54, 2781684],
        [1708470000000, 123.34, 124.91, 123.02, 124.55, 2242799],
        [1708556400000, 125.05, 126.29, 124.69, 125.2, 1519308],
        [1708642800000, 125.47, 126.54, 124.38, 124.78, 3039702],
        [1708902000000, 124.56, 125, 122.91, 124.12, 1384060],
        [1708988400000, 123.71, 124.65, 122.95, 122.99, 2684702],
        [1709074800000, 122.92, 123.91, 122.35, 122.53, 1396486],
        [1709161200000, 123.03, 124.3, 122.95, 123.64, 2311180],
        [1709247600000, 123.65, 125.84, 122.92, 124.73, 1604076],
        [1709506800000, 124.4, 125.02, 123.87, 124.53, 1127167],
        [1709593200000, 124.15, 125.15, 123.91, 125, 2934650],
        [1709679600000, 125.16, 125.87, 124.58, 125.83, 1632398],
        [1709766000000, 126.19, 126.75, 125.02, 126.68, 1567006],
        [1709852400000, 126.75, 127.04, 125.65, 126.2, 2645611],
        [1710111600000, 126.7, 129.01, 125.47, 127.89, 2469590],
        [1710198000000, 127.94, 128.53, 127.88, 128.16, 2400243],
        [1710284400000, 127.64, 128.09, 126.66, 127.41, 2265322],
        [1710370800000, 127.25, 127.68, 127.14, 127.26, 1137870],
        [1710457200000, 127.32, 128.23, 126.15, 126.75, 1285995],
        [1710716400000, 126.46, 126.7, 126.33, 126.35, 1722127],
        [1710802800000, 126.11, 127.02, 125.11, 125.3, 2221321],
        [1710889200000, 125.73, 126.6, 125.42, 125.65, 1117532],
        [1710975600000, 125.31, 126.79, 124.28, 125.57, 2412590],
        [1711062000000, 125.65, 125.94, 123.61, 124.78, 2400853],
        [1711321200000, 124.3, 125.17, 123.72, 124.74, 2631048],
        [1711407600000, 124.72, 125.13, 123.87, 123.98, 2130427],
        [1711494000000, 123.72, 123.96, 122.25, 122.76, 2659315],
        [1711580400000, 122.9, 123.3, 122.88, 123.2, 2236012],
        [1711666800000, 123.64, 123.69, 121.51, 122.65, 1292984],
        [1711926000000, 122.76, 124.32, 122.22, 123.2, 2315271],
        [1712012400000, 122.86, 123.82, 121.23, 122.23, 1392543],
        [1712098800000, 122.43, 122.78, 120.19, 121.31, 2454279],
        [1712185200000, 120.96, 121.06, 119.49, 119.87, 1802932],
        [1712271600000, 120.1, 120.31, 118.66, 119.18, 2510511],
        [1712530800000, 119.18, 119.97, 117.98, 118.48, 3036176],
        [1712617200000, 118.26, 118.39, 116.68, 117.05, 3378975],
        [1712703600000, 116.59, 117.16, 115.09, 115.44, 1497901],
        [1712790000000, 115.45, 115.49, 114.56, 114.61, 2520859],
        [1712876400000, 114.8, 115.25, 113.8, 114.39, 1340362],
        [1713135600000, 114.37, 114.75, 112.66, 113.43, 3193783],
        [1713222000000, 113.23, 114.3, 112.17, 113.33, 1108586],
        [1713308400000, 113.83, 115.11, 113.31, 114.49, 1405639],
        [1713394800000, 114.49, 115.22, 113.46, 114.94, 2785429],
        [1713481200000, 115.15, 116.41, 114.69, 115.58, 1322198],
        [1713740400000, 115.33, 116.66, 114.77, 115.61, 1616945],
        [1713826800000, 115.68, 117.26, 115.12, 116.52, 2761081],
        [1713913200000, 116.01, 116.83, 115.41, 115.6, 2530122],
        [1713999600000, 115.61, 115.68, 114.14, 115.05, 1427524],
        [1714086000000, 115.51, 116.16, 113.85, 114.79, 2638180],
        [1714345200000, 114.29, 114.64, 113.35, 114.44, 1606863],
        [1714431600000, 114.25, 114.6, 112.66, 113.47, 2574416],
        [1714518000000, 113.68, 114.47, 112.9, 113.6, 1692422],
        [1714604400000, 113.98, 114.5, 112.94, 113.6, 1208364],
        [1714690800000, 113.85, 114.69, 113.62, 113.98, 2004179],
        [1714950000000, 114.24, 116.01, 114.17, 115.07, 1364330],
        [1715036400000, 115.33, 117.84, 115.1, 116.68, 2739886],
        [1715122800000, 117.2, 118.68, 116.2, 117.91, 2887215],
        [1715209200000, 118.1, 118.53, 117.52, 117.84, 1441675],
        [1715295600000, 118.35, 119.02, 117.77, 117.87, 1768139],
        [1715554800000, 117.43, 118.61, 116.58, 118.55, 2425012],
        [1715641200000, 118.22, 120.83, 118.11, 119.74, 2899608],
        [1715727600000, 120.15, 121.77, 119.13, 121.18, 1294315],
        [1715814000000, 120.89, 121.74, 119.72, 121.03, 1590025],
        [1715900400000, 120.98, 121.41, 120, 121.3, 1784430],
        [1716159600000, 121.61, 123.7, 120.97, 122.76, 2567899],
        [1716246000000, 122.98, 124.23, 122.09, 123.12, 2256809],
        [1716332400000, 122.72, 123.31, 122.17, 122.56, 1831598],
        [1716418800000, 122.04, 123.54, 120.89, 123.51, 2361684],
        [1716505200000, 123.62, 124.95, 123.53, 123.91, 2562766],
        [1716764400000, 123.37, 124.5, 122.28, 123.1, 1350847],
        [1716850800000, 122.65, 123.82, 122.11, 123.17, 1527692],
        [1716937200000, 123.44, 124.64, 122.72, 122.91, 1531183],
        [1717023600000, 123.3, 124.3, 123.22, 123.68, 1266601],
        [1717110000000, 123.78, 124.71, 122.76, 123.11, 1430131],
        [1717369200000, 122.83, 124.63, 121.93, 123.53, 2041801],
        [1717455600000, 123.18, 123.29, 121.75, 122.75, 2512594],
        [1717542000000, 122.79, 124.02, 122.26, 123.87, 2296949],
        [1717628400000, 123.52, 125.5, 122.3, 124.33, 1277617],
        [1717714800000, 124.05, 124.36, 123.01, 123.54, 2199682],
        [1717974000000, 123.06, 123.35, 122.37, 123.18, 2019733],
        [1718060400000, 122.96, 123.99, 122.44, 122.65, 2224920],
        [1718146800000, 122.13, 122.6, 121.44, 122.23, 1161423],
        [1718233200000, 122.65, 123.4, 122.01, 122.73, 2520557],
        [1718319600000, 122.7, 124.04, 122.35, 123.4, 1861809],
        [1718578800000, 123.94, 124.77, 122.38, 123.57, 2782811],
        [1718665200000, 123.5, 125.18, 122.55, 124.23, 2896411],
        [1718751600000, 123.93, 125.11, 122.64, 123.84, 1282477],
        [1718838000000, 124.23, 124.81, 121.99, 123.2, 2131432],
        [1718924400000, 123.3, 124.15, 121.74, 122.48, 2059580],
        [1719183600000, 122.39, 122.62, 121.24, 121.85, 2811125],
        [1719270000000, 122.3, 123.75, 121.46, 122.98, 2620313],
        [1719356400000, 122.43, 123.54, 122.05, 122.7, 1730642],
        [1719442800000, 123.03, 123.46, 122.19, 122.65, 1380303],
        [1719529200000, 122.55, 123.11, 120.45, 121.61, 2274485],
        [1719788400000, 121.34, 121.99, 121.15, 121.31, 1511243],
        [1719874800000, 121.39, 122.08, 121.03, 121.56, 2508904],
        [1719961200000, 121.83, 121.88, 120.34, 120.61, 2605313],
        [1720047600000, 120.29, 121.48, 118.75, 119.7, 2788702],
        [1720134000000, 120.11, 121.48, 119.93, 120.45, 2014996],
        [1720393200000, 120.06, 120.75, 119.02, 119.6, 1336157],
        [1720479600000, 119.26, 119.81, 118.72, 119.67, 1295367],
        [1720566000000, 119.61, 119.91, 118.67, 119.16, 2060607],
        [1720652400000, 119.68, 120.85, 117.36, 118.09, 3489004],
        [1720738800000, 117.85, 118.51, 117.28, 118.26, 1143586],
        [1720998000000, 118.03, 118.04, 115.7, 116.85, 2217759],
        [1721084400000, 116.54, 117.19, 116.15, 116.75, 1061908],
        [1721170800000, 117.04, 118.09, 116.15, 117.64, 1215292],
        [1721257200000, 118.14, 118.26, 117.12, 117.98, 1407548],
        [1721343600000, 118.17, 118.84, 117.06, 118.83, 2112049],
        [1721602800000, 119.19, 120.32, 117.65, 118.1, 1498707],
        [1721689200000, 118.43, 119.53, 118.14, 118.3, 1636824],
        [1721775600000, 118.4, 119.37, 117.53, 117.83, 2579270],
        [1721862000000, 117.66, 118.48, 116.54, 118.38, 2726812],
        [1721948400000, 117.96, 118.93, 117.39, 118.54, 2444525],
        [1722207600000, 118.6, 120.25, 118.16, 119.39, 2027665],
        [1722294000000, 119.05, 119.84, 118.12, 118.18, 1856107],
        [1722380400000, 118.31, 119.44, 118.18, 118.8, 1791680],
        [1722466800000, 119.13, 120.62, 118.86, 119.78, 1891701],
        [1722553200000, 119.71, 120.03, 118.24, 119.25, 1495619],
        [1722812400000, 119.57, 120.67, 118.25, 119, 1986432],
        [1722898800000, 118.5, 119.65, 117.28, 117.56, 1711235],
        [1722985200000, 117.27, 117.37, 116.35, 117.33, 1700545],
        [1723071600000, 117.06, 118.5, 116.39, 117.85, 1667440],
        [1723158000000, 118.06, 118.78, 117.17, 117.28, 3134529],
        [1723417200000, 117.55, 117.88, 116.05, 116.5, 2264183],
        [1723503600000, 116.07, 117.5, 115.2, 116.6, 1197304],
        [1723590000000, 116.76, 117.24, 115.44, 116.17, 1449838],
        [1723676400000, 115.77, 116.56, 114.95, 115.94, 2198056],
        [1723762800000, 115.93, 116.82, 114.54, 115.68, 2142287],
        [1724022000000, 115.29, 116.13, 115.21, 115.39, 1101662],
        [1724108400000, 115.26, 116.42, 114.8, 115.31, 2214227],
        [1724194800000, 115.17, 115.18, 114.92, 115.16, 1234419],
        [1724281200000, 115.46, 116.21, 113.87, 114.78, 1893263],
        [1724367600000, 114.67, 115.76, 114.36, 115.19, 1439440],
        [1724626800000, 114.72, 114.86, 114.49, 114.62, 1849040],
        [1724713200000, 114.89, 115.5, 113.19, 114.11, 1799519],
        [1724799600000, 114.61, 114.67, 113.12, 113.44, 1849730],
        [1724886000000, 113.46, 113.48, 112.86, 113.45, 1558799],
        [1724972400000, 113.4, 114.49, 112.15, 112.41, 2933105],
        [1725231600000, 112.32, 113.88, 112.1, 113.17, 3061576],
        [1725318000000, 113.08, 113.86, 112.61, 113.83, 1542113],
        [1725404400000, 114.14, 115.61, 113.22, 114.53, 1347835],
        [1725490800000, 114.96, 115.3, 114.4, 115.04, 2465676],
        [1725577200000, 115.32, 116.91, 114.33, 116, 1519150],
        [1725836400000, 115.69, 116.74, 114.74, 116.15, 2275863],
        [1725922800000, 115.89, 116.31, 114.87, 115.1, 1406014],
        [1726009200000, 115.49, 115.84, 114.49, 115.78, 2501320],
        [1726095600000, 116.07, 117.17, 115.37, 116.7, 1713567],
        [1726182000000, 117.21, 118.27, 117.04, 117.41, 1384321],
        [1726441200000, 117.77, 118.3, 116.55, 117.54, 1548988],
        [1726527600000, 117.64, 119.46, 116.61, 118.56, 2959879],
        [1726614000000, 118.16, 119.77, 117.82, 118.64, 2459306],
        [1726700400000, 118.86, 119.83, 117.6, 118.06, 1274664],
        [1726786800000, 117.6, 118.08, 116.83, 117.04, 2845304],
        [1727046000000, 116.58, 117.61, 115.68, 117.11, 1271280],
        [1727132400000, 117.33, 117.46, 115.72, 116.65, 1608770],
        [1727218800000, 116.2, 116.86, 116.19, 116.66, 1104969],
        [1727305200000, 116.5, 117.45, 115.4, 117.03, 2702510],
        [1727391600000, 117.35, 119.04, 116.38, 118.59, 2396772],
        [1727650800000, 118.83, 120.59, 118.01, 119.51, 2511877],
        [1727737200000, 119.55, 120.29, 118.67, 119.32, 2677775],
        [1727823600000, 118.98, 119.84, 117.93, 119.43, 1961444],
        [1727910000000, 119.16, 120.57, 118.02, 119.51, 1496831],
        [1727996400000, 119.24, 119.96, 118.22, 118.83, 2311824],
        [1728255600000, 118.86, 119.34, 118.08, 118.69, 2552064],
        [1728342000000, 118.59, 119.29, 118.55, 118.98, 1368180],
        [1728428400000, 118.45, 118.66, 117.81, 118.17, 2455592],
        [1728514800000, 117.79, 118.82, 116.73, 118.8, 2443417],
        [1728601200000, 118.62, 119.95, 117.82, 119.2, 1390301],
        [1728860400000, 119.59, 120.19, 119.02, 119.37, 1070684],
        [1728946800000, 119.61, 121.52, 118.9, 121.02, 2964044],
        [1729033200000, 121.41, 122.43, 120.04, 120.7, 2353592],
        [1729119600000, 120.68, 120.81, 119.19, 120.1, 1235671],
        [1729206000000, 119.61, 121.67, 119.54, 120.72, 2457567],
        [1729465200000, 121.14, 121.45, 119.73, 120.85, 1164780],
        [1729551600000, 121, 122.64, 119.84, 121.56, 2406322],
  // ... truncated, use Copy or open the full config

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 stock-timeframe.json --out stock-timeframe.svg --with-table` (save the options above as JSON first)
