1. Reference
  2. Display

<series>

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

Display
series.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>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
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.
string
dashed A dashed line (a prior period).
boolean
false
data The values: a JSON array ([120, 340, null, 410]; null leaves a gap), a comma list, or a $var holding either.
string
fill Fill under this line (every line in type="area").
boolean
false
in Rows instead of data=: a model (follows its table) or a $var list of objects, as in <@foreach>.
string
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.
number
label The field of each row that labels the x axis, when <chart> has no labels=.
string
limit At most this many rows.
number
name What the series is (This week).
string
order Sort rows, as in <@foreach>.
string
value The field of each row that is plotted.
string
value
where Filter rows, as in <@foreach>.
string
width Line width in px (2; a sparkline 1.5).
number

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.

This page is also Markdown, and all of HAM is in llms.txt.