demo D204
Statistical process control
Control limits against spec limits, which are not the same thing
type: 'control', y, baseline
Loading a live grid…
The configuration
<script>
import { createGrid } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/lattice-grid.esm.min.js';
import createLatticeAction from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/modules/svelte.esm.min.js';
import { createChart } from 'https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/modules/charts.esm.min.js';
const lattice = createLatticeAction({ createGrid });
let chartEl;
const config = {
rowKey: 'id',
columns: [
{ field: 'part', title: 'Part', layout: { width: 110 } },
// The spec declares the tolerance; the control chart reads it.
{ field: 'bore', title: 'Bore', type: 'number',
spec: { lower: 9.5, upper: 10.8, target: 10 } },
],
rows, // machined bore measurements
// onGrid hands over the live grid the moment it is created. baseline sets the
// control limits over the first readings, and the chart follows the grid's
// filters and sort from then on.
onGrid: (grid) => {
createChart({ grid, container: chartEl, type: 'control', y: 'bore', baseline: 20 });
},
};
</script>
<svelte:head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.27.0/lattice-grid.min.css">
</svelte:head>
<div bind:this={chartEl} style="height: 340px"></div>
<div use:lattice={config} style="height: 320px; margin-top: 14px"></div>