Line chart
Since 0.1.0-alpha.22A line chart is the standard way to show change over time. The value axis doesn't have to start at zero, so small changes show. More than four or five lines get hard to follow. Highlight the one that matters, or give each line its own chart.
A few lines over time
ChartLineSeries in a Chart takes each item's Value. To write each line's name where it ends, so the reader doesn't look across to a legend, set EndLabel.
Static
Preview
| Month | Web | iOS | Android |
|---|---|---|---|
| 1/1/2025 | 182K | 64K | 41K |
| 2/1/2025 | 186K | 69K | 44K |
| 3/1/2025 | 191K | 75K | 46K |
| 4/1/2025 | 189K | 82K | 51K |
| 5/1/2025 | 194K | 88K | 55K |
| 6/1/2025 | 198K | 96K | 58K |
| 7/1/2025 | 196K | 103K | 63K |
| 8/1/2025 | 201K | 109K | 66K |
| 9/1/2025 | 205K | 118K | 72K |
| 10/1/2025 | 203K | 126K | 77K |
| 11/1/2025 | 207K | 131K | 80K |
| 12/1/2025 | 211K | 139K | 86K |
| 1/1/2026 | 209K | 146K | 91K |
| 2/1/2026 | 212K | 152K | 95K |
| 3/1/2026 | 214K | 160K | 101K |
| 4/1/2026 | 213K | 167K | 106K |
| 5/1/2026 | 216K | 171K | 110K |
| 6/1/2026 | 219K | 178K | 117K |
| 7/1/2026 | 217K | 184K | 121K |
| 8/1/2026 | 220K | 190K | 126K |
| 9/1/2026 | 222K | 194K | 133K |
| 10/1/2026 | 221K | 199K | 137K |
| 11/1/2026 | 224K | 205K | 142K |
| 12/1/2026 | 226K | 211K | 149K |
Code
@* Weekly active users of three apps over two years: a few lines over time, on a date scale, each named where it ends. *@
<Chart Items="_months" Argument="m => m.Month" Title="Weekly active users by app, 2025–2026">
<ChartValueAxis Format="#,##0,K" />
<ChartLineSeries Value="m => m.Web" Name="Web" EndLabel />
<ChartLineSeries Value="m => m.Ios" Name="iOS" EndLabel />
<ChartLineSeries Value="m => m.Android" Name="Android" EndLabel />
</Chart>
{
private record AppMonth(DateOnly Month, int Web, int Ios, int Android);
private static readonly int[] WebUsers = [182_000, 186_000, 191_000, 189_000, 194_000, 198_000, 196_000, 201_000, 205_000, 203_000, 207_000, 211_000, 209_000, 212_000, 214_000, 213_000, 216_000, 219_000, 217_000, 220_000, 222_000, 221_000, 224_000, 226_000];
private static readonly int[] IosUsers = [64_000, 69_000, 75_000, 82_000, 88_000, 96_000, 103_000, 109_000, 118_000, 126_000, 131_000, 139_000, 146_000, 152_000, 160_000, 167_000, 171_000, 178_000, 184_000, 190_000, 194_000, 199_000, 205_000, 211_000];
private static readonly int[] AndroidUsers = [41_000, 44_000, 46_000, 51_000, 55_000, 58_000, 63_000, 66_000, 72_000, 77_000, 80_000, 86_000, 91_000, 95_000, 101_000, 106_000, 110_000, 117_000, 121_000, 126_000, 133_000, 137_000, 142_000, 149_000];
private readonly AppMonth[] _months = Enumerable.Range(0, 24)
.Select(i => new AppMonth(new DateOnly(2025, 1, 1).AddMonths(i), WebUsers[i], IosUsers[i], AndroidUsers[i]))
.ToArray();
}Add this example to a page with the izzy CLI:
izzy add component ChartLineSeries --at <file>:<line>With dates as the Argument, the points sit on a date scale, with a tick per month or year as the width allows.
Keep to a few lines. Each takes the next color and a dash pattern and marker of its own, so they differ by more than color. With every line named, the chart leaves the legend out.
Everything on the Chart page works with every series type.
Daily values and a moving average
Daily numbers swing with the day of the week, which hides where they're heading. Trend="ChartTrend.MovingAverage" with a TrendPeriod of 7 draws the average of each week beside the daily line, so the direction reads at a glance and the days stay in view. With this many points, the line has no markers.
Static
Preview
- Signups
- Signups, 7-day average
| Date | Signups | Signups, 7-day average |
|---|---|---|
| 8/6/2026 | 140 | |
| 8/7/2026 | 156 | |
| 8/8/2026 | 95 | |
| 8/9/2026 | 112 | |
| 8/10/2026 | 161 | |
| 8/11/2026 | 155 | |
| 8/12/2026 | 172 | 141.57 |
| 8/13/2026 | 165 | 145.14 |
| 8/14/2026 | 181 | 148.71 |
| 8/15/2026 | 120 | 152.29 |
| 8/16/2026 | 113 | 152.43 |
| 8/17/2026 | 183 | 155.57 |
| 8/18/2026 | 176 | 158.57 |
| 8/19/2026 | 191 | 161.29 |
| 8/20/2026 | 183 | 163.86 |
| 8/21/2026 | 175 | 163 |
| 8/22/2026 | 135 | 165.14 |
| 8/23/2026 | 127 | 167.14 |
| 8/24/2026 | 196 | 169 |
| 8/25/2026 | 187 | 170.57 |
| 8/26/2026 | 178 | 168.71 |
| 8/27/2026 | 192 | 170 |
| 8/28/2026 | 182 | 171 |
| 8/29/2026 | 117 | 168.43 |
| 8/30/2026 | 131 | 169 |
| 8/31/2026 | 176 | 166.14 |
| 9/1/2026 | 189 | 166.43 |
| 9/2/2026 | 179 | 166.57 |
| 9/3/2026 | 169 | 163.29 |
| 9/4/2026 | 183 | 163.43 |
| 9/5/2026 | 118 | 163.57 |
| 9/6/2026 | 131 | 163.57 |
| 9/7/2026 | 176 | 163.57 |
| 9/8/2026 | 166 | 160.29 |
| 9/9/2026 | 180 | 160.43 |
| 9/10/2026 | 170 | 160.57 |
| 9/11/2026 | 184 | 160.71 |
| 9/12/2026 | 120 | 161 |
| 9/13/2026 | 111 | 158.14 |
| 9/14/2026 | 180 | 158.71 |
| 9/15/2026 | 171 | 159.43 |
| 9/16/2026 | 186 | 160.29 |
| 9/17/2026 | 178 | 161.43 |
| 9/18/2026 | 170 | 159.43 |
| 9/19/2026 | 130 | 160.86 |
| 9/20/2026 | 122 | 162.43 |
| 9/21/2026 | 170 | 161 |
| 9/22/2026 | 186 | 163.14 |
| 9/23/2026 | 179 | 162.14 |
| 9/24/2026 | 195 | 164.57 |
| 9/25/2026 | 189 | 167.29 |
| 9/26/2026 | 127 | 166.86 |
| 9/27/2026 | 144 | 170 |
| 9/28/2026 | 193 | 173.29 |
| 9/29/2026 | 209 | 176.57 |
| 9/30/2026 | 203 | 180 |
| 10/1/2026 | 197 | 180.29 |
| 10/2/2026 | 213 | 183.71 |
| 10/3/2026 | 152 | 187.29 |
| 10/4/2026 | 169 | 190.86 |
| 10/5/2026 | 218 | 194.43 |
| 10/6/2026 | 212 | 194.86 |
| 10/7/2026 | 229 | 198.57 |
| 10/8/2026 | 222 | 202.14 |
| 10/9/2026 | 239 | 205.86 |
| 10/10/2026 | 177 | 209.43 |
| 10/11/2026 | 170 | 209.57 |
| 10/12/2026 | 241 | 212.86 |
| 10/13/2026 | 234 | 216 |
| 10/14/2026 | 226 | 215.57 |
| 10/15/2026 | 241 | 218.29 |
| 10/16/2026 | 233 | 217.43 |
| 10/17/2026 | 193 | 219.71 |
| 10/18/2026 | 185 | 221.86 |
| 10/19/2026 | 231 | 220.43 |
| 10/20/2026 | 245 | 222 |
| 10/21/2026 | 236 | 223.43 |
| 10/22/2026 | 250 | 224.71 |
| 10/23/2026 | 241 | 225.86 |
| 10/24/2026 | 176 | 223.43 |
| 10/25/2026 | 190 | 224.14 |
| 10/26/2026 | 235 | 224.71 |
| 10/27/2026 | 248 | 225.14 |
| 10/28/2026 | 238 | 225.43 |
| 10/29/2026 | 228 | 222.29 |
| 10/30/2026 | 242 | 222.43 |
| 10/31/2026 | 177 | 222.57 |
| 11/1/2026 | 190 | 222.57 |
| 11/2/2026 | 235 | 222.57 |
| 11/3/2026 | 225 | 219.29 |
Code
@* Daily signups over 90 days, noisy by weekday, with a 7-day moving average that shows the direction. *@
<Chart Items="_days" Argument="d => d.Date" Title="Daily signups, last 90 days">
<ChartLineSeries Value="d => d.Signups" Name="Signups" Trend="ChartTrend.MovingAverage" TrendPeriod="7" />
</Chart>
{
private record Day(DateOnly Date, int Signups);
private readonly Day[] _days = Enumerable.Range(0, 90).Select(i =>
{
var date = new DateOnly(2026, 8, 6).AddDays(i);
var weekend = date.DayOfWeek is DayOfWeek.Saturday or DayOfWeek.Sunday;
return new Day(date, 140 + i + (int)(18 * Math.Sin(i / 9.0)) + (i * 37 % 23) - (weekend ? 55 : 0));
}).ToArray();
}Smooth lines
Curve="ChartCurve.Smooth" draws a curve through the values, which suits a measure that changes continuously between readings, such as temperature. The curve never overshoots a value, so it doesn't invent peaks the data doesn't have. Keep straight lines for counts and totals, where a curve suggests values between the points that were never measured.
Static
Preview
| Month | Chicago | Sydney |
|---|---|---|
| Jan | 0° | 26° |
| Feb | 2° | 26° |
| Mar | 9° | 25° |
| Apr | 15° | 23° |
| May | 21° | 20° |
| Jun | 27° | 18° |
| Jul | 29° | 17° |
| Aug | 28° | 18° |
| Sep | 24° | 20° |
| Oct | 17° | 22° |
| Nov | 9° | 24° |
| Dec | 3° | 25° |
Code
@* Average temperature by month in two cities: a measure that changes continuously between readings, drawn as smooth lines. *@
<Chart Items="_months" Argument="m => m.Month" Title="Average high temperature by month (°C)">
<ChartValueAxis Format="0'°'" />
<ChartLineSeries Value="m => m.Chicago" Name="Chicago" Curve="ChartCurve.Smooth" EndLabel />
<ChartLineSeries Value="m => m.Sydney" Name="Sydney" Curve="ChartCurve.Smooth" EndLabel />
</Chart>
{
private record MonthTemperature(string Month, double Chicago, double Sydney);
private readonly MonthTemperature[] _months =
[
new("Jan", 0, 26), new("Feb", 2, 26), new("Mar", 9, 25), new("Apr", 15, 23),
new("May", 21, 20), new("Jun", 27, 18), new("Jul", 29, 17), new("Aug", 28, 18),
new("Sep", 24, 20), new("Oct", 17, 22), new("Nov", 9, 24), new("Dec", 3, 25),
];
}Step lines
Curve="ChartCurve.Step" holds each value flat until the next one's date, then steps: for values that stay put until they change, such as a price, a rate or a plan's tier. Add a last item at today's date so the current value runs to the present.
Static
Preview
| Date | Price per seat |
|---|---|
| 1/1/2024 | $8 |
| 7/1/2024 | $10 |
| 3/1/2025 | $12 |
| 9/15/2025 | $11 |
| 4/1/2026 | $14 |
| 11/7/2026 | $14 |
Code
@* A plan's price per seat over three years: it holds until the next change, so it's drawn as steps. *@
<Chart Items="_prices" Argument="p => p.Date" Title="Team plan price per seat, 2024–2026">
<ChartValueAxis Format="$0" Min="0" />
<ChartLineSeries Value="p => p.Price" Name="Price per seat" Curve="ChartCurve.Step" />
</Chart>
{
private record PriceChange(DateOnly Date, decimal Price);
// Each change, and today, so the last price runs to the present.
private readonly PriceChange[] _prices =
[
new(new DateOnly(2024, 1, 1), 8),
new(new DateOnly(2024, 7, 1), 10),
new(new DateOnly(2025, 3, 1), 12),
new(new DateOnly(2025, 9, 15), 11),
new(new DateOnly(2026, 4, 1), 14),
new(new DateOnly(2026, 11, 7), 14),
];
}Details
Each line series is one line, and several lines differ by dash as well as by color.
Mode support
| Feature | Static | Interactive |
|---|---|---|
| Lines over dates, numbers or names, straight, smooth or stepped | Yes | Yes |
| Dashes and marker shapes that tell lines apart besides color | Yes | Yes |
| Each line's name at its end, nudged apart where lines end close together | Yes | Yes |
| Drawn on the server, as wide as its container, with labels that thin out as it narrows | Yes | Yes |
| A table of the values behind a "Show data" button | Yes | Yes |
| Tooltips on hover and from the keyboard | Yes | Yes |
| Legend items that hide and show a series | Yes | Yes |
Static: static server-side rendering, with no circuit and no WebAssembly. Interactive: Server, WebAssembly or Auto.
Without JavaScript
Every page starts as plain HTML: before IzzyBlazor's script loads on a static page, while an interactive page prerenders, and with JavaScript off.
- Tooltips on hover and from the keyboard: waits for the script
- Legend items that hide and show a series: waits for the script
Parameters
| Prop | Type | Default |
|---|---|---|
LineStyleHow the line is drawn. | ChartLineStyle? | computed |
CurveThe line's shape between values. | ChartCurve | ChartCurve.Straight |
MarkersWhether each value is marked. | bool? | computed |
ConnectGapsDraws the line straight across a missing value, instead of leaving a gap. | bool | false |
EndLabelWrites the series' name just past the plot's end, level with its last value, in its color: the reader names the line where it ends, without looking across to a legend. | bool | false |
ValueThe value to draw, such as m => m.Revenue: any number, or null for none. | Expression<Func<TItem, object?>> | Required |
AggregateWith ChartDrillLevel<T>s, how each level adds up its items' values: DataAggregate.Sum (the default), DataAggregate.Avg, DataAggregate.Min, DataAggregate.Max or DataAggregate.Count (the items with a value). | DataAggregate | DataAggregate.Sum |
NameThe series' name, in the legend, the data table and each value's description. | string? | computed |
SeriesBySplits the series into one per value of this, such as p => p.Device: each draws only its own items' values, is named by its value, and takes the next color and marker, in the order the values first appear. | Expression<Func<TItem, object?>>? | |
ColorA CSS color, such as var(--ib-color-danger) or #0f766e. | string? | computed |
LabelsWrites each value beside its bar or point. | ChartLabels | ChartLabels.None |
LabelFormatA .NET format string for this series' labels, such as C0. | string? | computed |
LabelTextWhat each label says in place of its value, such as r => r.Region to name each bubble or point. | Expression<Func<TItem, object?>>? | |
LabelOverlapWhat labels do when they'd overlap others: left out at those widths (ChartLabelOverlap.Hide, the default), or shown anyway (ChartLabelOverlap.Show). | ChartLabelOverlap | ChartLabelOverlap.Hide |
TrendDraws a trend through the values: a dashed line in the series' color, named "Revenue trend" (a moving average "Revenue, 7-day average") in the legend, tooltips and data table. | ChartTrend | ChartTrend.None |
TrendOrderA polynomial trend's order, 2 (a parabola) to 6. | int | 2 |
TrendPeriodHow many values a moving average takes in, 2 or more. | int | 3 |
TrendColorThe trend's CSS color, such as var(--ib-color-danger), used as given. | string? | computed |
ValueAxisThe Name of the value axis the series is read off, for a measure in other units on a second axis at the end side, such as "margin". | string? | computed |
HiddenStarts with the series hidden: the chart is drawn as if it weren't there, and it keeps its place in the legend, to show it again, and in the data table. | bool | false |