Charts
Categories, hierarchies and flows
Totals per category, nested breakdowns, flows between stages and intervals in time.
Each chart below is drawn live from the data of its example. All kinds: Chart types.
Bar Chart
A Bar Chart chart drawn by the engine from the data of the example below.
Values per category as bars, grouped or stacked: totals per line, shift or month.
Data. A category column (text or numbers; rows with the same category add up) and one or more value columns.
Example
await engine.datasets.addText(`line,material,setup,operator
Line 1,42,18,9
Line 2,31,25,14
Line 3,55,12,6
Line 4,24,30,11
Line 5,38,16,20`, 'Scrap.csv')
const chart = engine.charts.add('barchart', {
title: 'Scrap by line',
settings: {
bcCategoryCol: 'line',
bcValueCols: ['material', 'setup', 'operator'],
bcMode: 'stacked',
bcAlarm: { value: 70, style: 'dashed', width: 1.5, color: '#f87171' },
},
})
engine.charts.mount(chart, document.getElementById('chart')!)Settings
| Name | Type | Description |
|---|---|---|
bcCategoryCol | stringDefault: '' | Category column; '' labels bars by row number. |
bcValueCols | string[]Default: [] | One bar (or segment) per column. |
bcMode | 'grouped' | 'stacked'Default: 'grouped' | Side by side or on top of each other. |
bcHorizontal | booleanDefault: false | Horizontal bars. |
bcValueScale | { scaleMin, scaleMax }Default: '' / '' | Fixed value axis as strings; '' is automatic. |
bcAlarm | AlarmLine | nullDefault: null | Reference line { value, style: "solid" | "dashed" | "dotted", width, color }; null for none. |
Treemap
A Treemap chart drawn by the engine from the data of the example below.
A hierarchy as nested rectangles sized by value: where the energy, cost or downtime goes, and which part of each area weighs most.
Data. Rows of name, parent and value. An empty parent (or one with no row of its own) makes a top-level area.
Example
await engine.datasets.addText(`name,parent,mwh
Press shop,,0
Paint shop,,0
Assembly,,0
Press A,Press shop,320
Press B,Press shop,260
Compressors,Press shop,140
Ovens,Paint shop,410
Booths,Paint shop,180
Line 1,Assembly,150
Line 2,Assembly,120
Lighting,Assembly,60`, 'Energy.csv')
const chart = engine.charts.add('treemap', {
title: 'Energy by area',
settings: { tmNameCol: 'name', tmParentCol: 'parent', tmValueCol: 'mwh' },
})
engine.charts.mount(chart, document.getElementById('chart')!)Settings
| Name | Type | Description |
|---|---|---|
tmNameCol | stringDefault: '' | Node name. |
tmParentCol | stringDefault: '' | Name of the parent node. |
tmValueCol | stringDefault: '' | Size of the leaves; parents add up their children. |
Sankey
A Sankey chart drawn by the engine from the data of the example below.
Flows between stages as bands whose width is the amount: material, energy or parts moving through a process, and where they are lost.
Data. Rows of source, target and value, one row per flow.
Example
await engine.datasets.addText(`from,to,tonnes
,,t
Coil,Blanking,100
Blanking,Stamping,88
Blanking,Scrap,12
Stamping,Welding,80
Stamping,Scrap,8
Welding,Paint,77
Welding,Scrap,3
Paint,Shipped,75
Paint,Scrap,2`, 'Flow.csv')
const chart = engine.charts.add('sankey', {
title: 'Material flow',
settings: { skSourceCol: 'from', skTargetCol: 'to', skValueCol: 'tonnes' },
})
engine.charts.mount(chart, document.getElementById('chart')!)Settings
| Name | Type | Description |
|---|---|---|
skSourceCol | stringDefault: '' | Node the flow leaves. |
skTargetCol | stringDefault: '' | Node the flow reaches. |
skValueCol | stringDefault: '' | Amount of the flow. |
Flame Graph
A Flame Graph chart drawn by the engine from the data of the example below.
A hierarchy as stacked bars whose width is the value: where the time of a cycle (or a program) goes, step by step.
Data. Rows of name, parent and value. An empty parent puts the row at the top.
Example
await engine.datasets.addText(`step,parent,seconds
Cycle,,0
Load,Cycle,0
Machine,Cycle,0
Unload,Cycle,6
Clamp,Load,4
Probe,Load,3
Rough,Machine,22
Finish,Machine,14
Tool change,Machine,0
Tool 1→2,Tool change,3
Tool 2→3,Tool change,4`, 'Cycle.csv')
const chart = engine.charts.add('flamegraph', {
title: 'Cycle time breakdown',
settings: { fgNameCol: 'step', fgParentCol: 'parent', fgValueCol: 'seconds', fgDirection: 'topdown' },
})
engine.charts.mount(chart, document.getElementById('chart')!)Settings
| Name | Type | Description |
|---|---|---|
fgNameCol | stringDefault: '' | Node name. |
fgParentCol | stringDefault: '' | Parent node; '' puts every row under the root. |
fgValueCol | stringDefault: '' | Own value of the node; parents add up their children. |
fgDirection | 'topdown' | 'bottomup'Default: 'topdown' | Root at the top or at the bottom. |
Gantt Chart
A Gantt Chart chart drawn by the engine from the data of the example below.
Intervals on a time axis, one bar per row: test steps, machine states, maintenance windows, grouped by resource.
Data. Rows with a label, a start and an end (numbers on the same axis); optionally a group.
Example
await engine.datasets.addText(`task,start,end,rig
Warm-up,0,2,Rig A
Endurance,2,14,Rig A
Teardown,14,16,Rig A
Calibration,1,3,Rig B
Thermal cycles,3,10,Rig B
Vibration,10,15,Rig B
Report,15,18,Office`, 'Campaign.csv')
const chart = engine.charts.add('gantt', {
title: 'Test campaign',
settings: {
gtLabelCol: 'task',
gtStartCol: 'start',
gtEndCol: 'end',
gtGroupCol: 'rig',
gtAlarm: { value: 16, style: 'dashed', width: 1.5, color: '#f87171' },
},
})
engine.charts.mount(chart, document.getElementById('chart')!)Settings
| Name | Type | Description |
|---|---|---|
gtLabelCol | stringDefault: '' | Bar label. |
gtStartCol | stringDefault: '' | Start of each bar. |
gtEndCol | stringDefault: '' | End of each bar. |
gtGroupCol | stringDefault: '' | Group (colour and order) of each bar; '' for none. |
gtAlarm | AlarmLine | nullDefault: null | Vertical line at a time (a deadline). |