demo D179
Statistics in the totals row
Median, percentiles, deviation and spread, each over the filtered rows
total: 'median' · 'p95' · 'stddev'
Loading a live grid…
The configuration
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.13.0/lattice-grid.min.css">
<script src="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.13.0/lattice-grid.min.js"></script>
<div id="grid" style="height: 460px"></div>
<script>
const grid = LatticeGrid.createGrid(document.getElementById('grid'), {
rowKey: 'id',
columnDefaults: { filter: true },
columns: [
{ field: 'reference', title: 'Reference', layout: { pin: 'start', width: 150 } },
{ field: 'desk', title: 'Desk', filter: { type: 'set' } },
// Each column names its own reduction: median, 95th percentile, deviation.
{ field: 'price', title: 'Price', type: 'number', total: 'median' },
{ field: 'bid', title: 'Bid', type: 'number', total: 'p95' },
{ field: 'volume', title: 'Volume', type: 'number', total: 'iqr' },
{ field: 'notional', title: 'Notional', type: 'number', total: 'sum' },
],
rows,
});
</script>