Warp Chart demo — charts for Filament you can dig into: drill-down, last year, budget lines, linked charts. Click anything; the data is reset every hour. warpui.com About Warp Chart Docs Ask a question Support
Skip to content

Charts in a form

A chart is a schema component, so it sits next to the fields. With Get $get it reads the fields and is drawn again as they change.

A margin chart that follows the quote

The repeater is ->live(debounce: 400). The number and the bar chart both work the cost and the margin out from the lines with ->data(fn (Get $get) => …).

Note: Try it

Change the quantity of the standing desks from 4 to 10: the bar grows and the total margin goes up. Add a line with an item, a quantity, a price and a cost: it gets its own bar. Nothing is saved.

Quote lines
    $
    $
    $
    $
    $
    $
Item, position 1 of 3Item, position 2 of 3Item, position 3 of 3

Total margin

Cost and margin per line

Without asking the server

->js() works the data out in the browser, reading the fields with $get(). The three fields are not ->live(): nothing is sent to the server while you type.

Note: Try it

Change the quantity from 12 to 20, one key at a time: the bars and the values on them follow every keystroke.

$
$

Choose the chart type with a field

->type(fn (Get $get) => $get('type')): any setting of a chart can be a closure.

Note: Try it

Choose “Line” or “Pie”: the same numbers are drawn as another chart.

Move a goal line by typing

->target(fn (Get $get) => $get('goal')).

Note: Try it

Type 60000: the line moves up and fewer months reach it. Clear the field and the line is gone.

$