# Chart visitors over time

URL: https://docs.analytics.remcostoeten.nl/docs/tutorial/chart-visitors

> Step 4 of 7. Read a visitors time series with the previous period and draw it as an SVG line chart.

This step adds a chart of visitors per bucket, with the period before drawn as a dashed line. It uses one more read and no chart library.

## 1. Add the chart

<StepDiff
  step="4"
  notes="[
  {
    file: &#x22;src/components/timeseries-chart.tsx&#x22;,
    match: 'scope.timeseries(&#x22;visitors&#x22;, { compare: &#x22;previous&#x22; })',
    text: &#x22;compare: \&#x22;previous\&#x22; adds a previous value to every point, from the period of the same length before this one.&#x22;,
  },
  {
    file: &#x22;src/components/timeseries-chart.tsx&#x22;,
    match: &#x22;formatBucket(point.bucket, interval)&#x22;,
    text: &#x22;The API picks the interval from the period: hours for 24h, days for longer periods. The response says which one it used.&#x22;,
  },
  {
    file: &#x22;src/app.tsx&#x22;,
    match: &#x22;<TimeseriesChart&#x22;,
    text: &#x22;Both panels read from the same scope and key, so they always show the same period.&#x22;,
  },
]"
/>

## 2. What the read returns

The last seven points of this site's own series, one per day:



Next, [add top lists and filters](https://docs.analytics.remcostoeten.nl/docs/tutorial/add-top-lists-and-filters.md).
