Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Titles

Since 0.1.0-alpha.22
A chart's title, or a heading on the page that titles it, such as a card's, so the title isn't written twice, and the title's size and alignment.

Titled by a heading

When a heading on the page already says what the chart shows, such as a card's title, set TitledBy to the heading's id instead of giving the chart a Title. A Card gives its heading an id with TitleId.

Static

Preview

New signups, last 7 days

Trials and paid plans

  • Trials
  • Paid
Arrow keys move between values; Escape hides the tooltip.

Code

InCard.razor
@* A dashboard card whose heading titles the chart: the chart takes its name from it and shows no
   title of its own. *@
<Card Title="New signups, last 7 days" TitleId="signups-heading" Description="Trials and paid plans" Width="Length.Full" MaxWidth="32.Rem">
    <Chart Items="_days" Argument="d => d.Day" TitledBy="signups-heading" Stacking="ChartStacking.Normal" Height="12.Rem">
        <ChartBarSeries Value="d => d.Trials" />
        <ChartBarSeries Value="d => d.Paid" />
    </Chart>
</Card>

@code {
    private record DaySignups(string Day, int Trials, int Paid);

    private readonly DaySignups[] _days =
    [
        new("Mon", 142, 31), new("Tue", 168, 38), new("Wed", 155, 35), new("Thu", 171, 42),
        new("Fri", 149, 33), new("Sat", 88, 14), new("Sun", 79, 12),
    ];
}

The chart and its Show data are named from the heading, so the title isn't written twice. For a chart with no heading near it, HideTitle keeps a Title for screen readers only.

To size every chart's own title at once, set --ib-chart-title-size (the theme's --ib-text-lg by default) and --ib-chart-title-weight in your CSS. TitleAlign moves the title to the Center or End.

Connection lost

Rejoining the server…