Components / ChartCard

ChartCard

A chart's card: title, description, what changes it, tabs with totals, and how it trends.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn chart_card() -> impl View {
    ChartCard::new(
        Chart::new(ChartKind::Area)
            .categories(["Jan", "Feb", "Mar", "Apr", "May", "Jun"])
            .series("Desktop", [186.0, 305.0, 237.0, 73.0, 209.0, 214.0])
            .series("Mobile", [80.0, 200.0, 120.0, 190.0, 130.0, 140.0])
            .stack(ChartStack::Normal)
            .gradient()
            .height(220.0),
    )
    .title("Visitors")
    .description("January to June")
    .trend("Up by 5.2% this month", IconName::TrendingUp)
    .note("All channels")
}

Open in the playground, with every example →

Full API of ChartCard →