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

From a pivot

If you also use Warp Pivot, our separate plugin for pivot tables, a chart can draw a pivot as it is: ->pivot(SalesPivot::class). The rows, columns, values, filters and permissions are the ones of the pivot, so they are defined once. Values that only the pivot has, such as the median, ratios and formulas, can be charted too.

The rows and columns of the pivot

The pivot has the categories and then the customers in its rows, and the order status in its columns. The chart takes the categories as bars, the statuses as series, and the customers as the level below.

Note: Try it

Click “Paper”: the chart shows the customers that bought paper, the next row level of the pivot. Back returns to the categories. Most orders are already shipped, so the other two statuses are thin slices: point at a bar to read all three.

Another value of the same pivot

The pivot has two values, the total and the median. ->pivot(SalesPivot::class, measure: 'total_median') charts the median.

Note: Try it

Point at a bar to read the median order of a category for each status. The median comes from the pivot; a query chart has no median. Clicking a bar goes down to the customers, as in the example above.

Months without a value stay on the axis

The pivot has the month of the order date in its rows and shows only the cancelled orders of Northwind Traders. Only some months have one, so the pivot has no row for the others. The chart fills the months in between with 0, so the axis does not jump from one month to a month far away. With ->period() it fills that whole period.

Note: Try it

Read the month names under the bars: every month from the first cancelled order to the last is there. Months without one are empty. Point at an empty month to read 0.

Yen without decimals, even with no value

The pivot is of refunds, and the demo has none, so there is no value to draw: every month of the period is 0. In a currency without decimals (->money('JPY')) the value axis still counts in whole numbers.

Note: Try it

Read the left axis: it counts 0, 1 … in whole yen. It does not use decimal ticks such as 0.2, 0.4 (that is what a currency with decimals, such as USD, would do).