# <series>

One line or set of bars inside a chart, with its own data, name, color and dash.

Category: Display.

```ham
<chart type="line"
       labels="Mon,Tue,Wed,Thu,Fri"
       format="money"
       highlight="last"
       style="text-gray-500">
    <series name="This week"
            data="[1200, 3400, 2800, 4100, 3900]"
            color="teal-600 dark:teal-300"/>
    <series name="Last week"
            data="[900, 2100, 2600, 3000, 3300]"
            color="gray-400"
            dashed/>
</chart>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/series-light.webp), [dark](https://hypeapps.dev/img/tags/series-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `color` | A color token (blue-600, #2563EB); several with prefixes pick by theme: "blue-600 dark:blue-300". Default: the theme color, then a palette. |  |
| `dashed` | A dashed line (a prior period). | `false` |
| `data` | The values: a JSON array ([120, 340, null, 410]; null leaves a gap), a comma list, or a $var holding either. |  |
| `fill` | Fill under this line (every line in type="area"). | `false` |
| `in` | Rows instead of data=: a model (follows its table) or a $var list of objects, as in <@foreach>. |  |
| `keep` | When data= is one number (a stream sends one value at a time), each new value is added at the end and only the last keep are drawn: <series data="$load" keep="30">. A list still replaces the data. |  |
| `label` | The field of each row that labels the x axis, when <chart> has no labels=. |  |
| `limit` | At most this many rows. |  |
| `name` | What the series is (This week). |  |
| `order` | Sort rows, as in <@foreach>. |  |
| `value` | The field of each row that is plotted. | `value` |
| `where` | Filter rows, as in <@foreach>. |  |
| `width` | Line width in px (2; a sparkline 1.5). |  |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Related tags

- [`<chart>`](https://hypeapps.dev/docs/reference/chart.md): A line, area, bar or sparkline chart drawn from a list of values; a tap shows a point's value.
- [`<ad>`](https://hypeapps.dev/docs/reference/ad.md): An ad slot in the page, filled with a banner from AdMob in a built app.
- [`<avatar>`](https://hypeapps.dev/docs/reference/avatar.md): A round avatar from a photo, initials or an icon, in any size and color.
- [`<badge>`](https://hypeapps.dev/docs/reference/badge.md): A small count or dot pinned to the corner of an icon or any other element.
- [`<canvas-tool>`](https://hypeapps.dev/docs/reference/canvas-tool.md): A drawing tool written in HAM and loaded into a draw pad as a plugin: touch handlers, state and options.
- [`<caption>`](https://hypeapps.dev/docs/reference/caption.md): A table caption, shown as a label above the table.
- [`<carousel>`](https://hypeapps.dev/docs/reference/carousel.md): Swipeable pages side by side, one at a time, with dots below that show which page is on screen.
- [`<countdown>`](https://hypeapps.dev/docs/reference/countdown.md): A timer that counts down to zero in a format you choose and can act when it gets there.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
