Lattice Grid Buy a licence

demo D205

Density over a histogram

A kernel density estimate over the bars, so binning and data separate

curve: true, buckets

Building…
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="chart" style="height: 340px"></div>
<div id="grid" style="height: 340px; margin-top: 14px"></div>

<script type="module">
  import { createChart } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.13.0/modules/charts';

  const grid = LatticeGrid.createGrid(document.getElementById('grid'), {
    rowKey: 'id',
    columns: [
      { field: 'symbol', title: 'Symbol', layout: { width: 120 } },
      { field: 'desk', title: 'Desk', filter: { type: 'set' } },
      { field: 'price', title: 'Price', type: 'number' },
      { field: 'bid', title: 'Bid', type: 'number' },
      { field: 'volume', title: 'Volume', type: 'number' },
      { field: 'notional', title: 'Notional', type: 'number',
        format: { style: 'currency', currency: 'USD' }, total: 'sum' },
    ],
    rows,
  });

  // curve draws a density estimate over the bars; buckets sets the bins.
  createChart({ grid, container: '#chart', type: 'histogram', y: 'price', buckets: 20, curve: true });
</script>