Chromatogram
What is a chromatogram?
A chromatogram is the graph a chromatography instrument produces: the detector's response plotted against the time since the sample was injected. Each compound in the mixture leaves the column at its own time and draws a peak. Where a peak sits identifies the compound; the area under it tells you how much is present.

A simulated HPLC chromatogram of five compounds, with each peak integrated and labelled with its retention time (sample data). Try the interactive version.
- The x-axis is time after injection; the y-axis is the detector's response. Each peak is a compound leaving the column.
- Retention time, from injection to the top of a peak, identifies a compound when compared with a standard run under the same conditions.
- Peak area, not height, is normally used to measure how much is present, through a calibration with known amounts.
- Resolution says how well two peaks are separated; 1.5 or more is baseline resolution.
- One peak can hide two compounds. Matching retention times suggest an identity but don't prove it.
Chromatogram vs chromatograph vs chromatography
The three words are often mixed up:
| Word | What it is | Example |
|---|---|---|
| Chromatography | The technique: separating the parts of a mixture by how strongly each one is held back as a fluid carries it through a column or across a surface | Reversed-phase liquid chromatography |
| Chromatograph | The instrument that does the separation | A gas chromatograph (GC), an HPLC system |
| Chromatogram | The record of one run: detector response against time | The trace on screen and in the report |
Every chromatograph works the same way. A small volume of sample is injected into a moving phase (a gas or a liquid), which carries it through a column packed or coated with a stationary phase. Compounds that cling to the stationary phase more strongly move more slowly. By the time they reach the detector at the far end, they have spread out in time. The detector measures something that rises when a compound passes, such as ultraviolet absorbance, ions formed in a flame or mass-to-charge ratio, and the data system plots it as the chromatogram.
Parts of a chromatogram
A chromatogram has a few standard parts: the injection point, the dead time, the baseline, and the peaks with their retention times, heights, widths and areas.
- Injection point. Time zero, when the sample enters the column. Every time on the chromatogram is measured from here.
- Dead time (, also void time or hold-up time). The time a compound that isn't held back at all takes to pass through. It often shows as a small blip or dip, the solvent front, where the injection solvent reaches the detector.
- Baseline. The signal when only the mobile phase is reaching the detector. In practice it is never perfectly flat: it drifts and carries noise.
- Peak. The detector's response as one compound (or several, if they overlap) passes. An ideal peak is a Gaussian, the bell curve.
- Peak height. From the baseline under the peak to its top.
- Peak area. The area between the peak and the baseline. For a given detector and compound, it is proportional to the amount injected.
- Peak width. Measured at half the peak's height (), or at the base between tangents drawn on its sides (, about 1.7 times the half-height width for a Gaussian).
Where is retention time on a chromatogram?
Retention time () is read along the horizontal axis: it is the time from the injection to the top (apex) of a peak. A peak whose top is at 4.20 minutes has a retention time of 4.20 min. Data systems print it above each peak and list it in the peak table.
Two related measures remove the effect of the column's dead volume:
- Adjusted retention time : the extra time the compound spent held on the stationary phase.
- Retention factor : how many times longer the compound spent in the stationary phase than in the mobile phase. A between about 1 and 10 is a comfortable range for most methods.
Peak tailing and fronting
Real peaks are rarely perfect bell curves.
- A tailing peak rises quickly and falls slowly, leaving a long tail. Common causes are strong secondary interactions with the stationary phase (basic compounds on silica in HPLC, for example), a damaged column or dead volume in the fittings.
- A fronting peak is the mirror image, with a sloping front. It usually means the column is overloaded, or the sample solvent is much stronger than the mobile phase.
Both are measured by the symmetry factor (USP <621>, also called the tailing factor) , where is the peak width at 5% of its height and is the distance from the front edge to the apex at that height. A symmetric peak has ; above 1 it tails, below 1 it fronts.
How to read a chromatogram
Reading a chromatogram answers two questions: what is in the sample, and how much of each.
- Check the run. Look at the baseline: is it flat, drifting or noisy? Find the injection and the solvent front at , and ignore anything before it.
- Count the peaks. Note any shoulders, valleys that don't reach the baseline, or peaks that look wider than their neighbours: each can be two compounds overlapping.
- Identify each peak by retention time. Compare it with a standard (a known pure compound) run on the same method on the same day. A match within a set window, often a few hundredths of a minute, suggests the same compound. Spiking the sample with the standard and seeing one peak grow is stronger evidence; a mass spectrum or UV spectrum across the peak is stronger still.
- Measure each peak by area. The data system integrates each peak: it decides where it starts and ends and draws a baseline under it.
- Turn area into amount. Run standards at known concentrations, plot area against concentration (the calibration curve) and read the sample's concentration off it. The "area %" column in a report only gives relative amounts, and only if every compound gives the same response per gram, which is rarely true.
- Check the separation. Look at the resolution between neighbouring peaks, especially the closest pair (the critical pair), and at the tailing factors, against the method's system suitability limits.
Peak height vs peak area
Area is normally preferred. When a peak gets broader, for example as a column ages or for later-eluting peaks in an isothermal GC run, its height falls but its area stays the same. Height can be the better choice for small peaks on a noisy or sloping baseline, or for a peak partly overlapping a large neighbour, where the area depends heavily on where the integration lines are drawn. Whichever you use, use the same for standards and samples.
Resolution and plate number: a worked example
Resolution () measures how well two neighbouring peaks are separated. With retention times and and base widths and :
Using widths at half height instead, , which data systems prefer because half-height widths are easier to measure on real peaks.
Plate number (, the column efficiency) measures how narrow the column keeps a peak relative to its retention time:
Take two peaks on a column with a dead time of 1.00 min:
| Peak 1 | Peak 2 | |
|---|---|---|
| Retention time | 4.20 min | 4.65 min |
| Base width | 0.20 min | 0.22 min |
| Retention factor | 3.20 | 3.65 |
| Plate number | 7,056 | about 7,150 |
- Resolution: . The pair is fully separated.
- Selectivity: .
- The Purnell equation links the three, , and gives about 2.0 here, close to the measured value.
The equation shows what to change when peaks overlap. Resolution grows only with the square root of : four times the plates (a column four times longer, or particles a quarter the size, since the plate number scales with column length divided by particle size) only doubles it. Changing selectivity, through the mobile phase, the column chemistry or the temperature, is usually far more effective, because even a small change in can move a peak right out of the way. Try both in the interactive chromatogram: raising the column efficiency narrows the peaks, while heating the column from 30 to 45 °C makes two compounds merge and then swap places.
| What it looks like | Overlap of two equal Gaussian peaks | |
|---|---|---|
| below 1.0 | A shoulder or a single merged peak | More than 2% |
| 1.0 | Two tops with a valley that dips to about a quarter of the peak height | About 2% |
| 1.5 | Back to the baseline between them (baseline resolution) | About 0.1% |
| 2.0 or more | A clear gap of baseline | Negligible |
Types of chromatogram
Chromatograms differ with the separation technique and the detector, but each one plots a detector signal against time.
HPLC vs GC chromatogram
The two most common chromatograms come from high-performance liquid chromatography (HPLC) and gas chromatography (GC). They look alike, but the axes and the peaks mean slightly different things.
| HPLC chromatogram | GC chromatogram | |
|---|---|---|
| Mobile phase | A liquid, pumped at high pressure | An inert gas (helium, hydrogen or nitrogen) |
| Best for | Compounds that are non-volatile, large or break down when heated: drugs, proteins, sugars | Compounds that vaporise without breaking down: solvents, fuels, fragrances, pesticides |
| Typical detector and y-axis | UV-visible absorbance in mAU (milli-absorbance units), or a mass spectrometer | Flame ionisation detector (FID) current in pA, or a mass spectrometer |
| What moves the peaks | Mobile phase composition (often a gradient), column chemistry, temperature | Oven temperature (often a ramp), column phase, gas flow |
| Typical peaks | Wider; early peaks are narrow and late ones broader in an isocratic run | Very narrow, especially on capillary columns; dozens to hundreds of peaks per run |
| Typical run length | A few minutes to an hour | A few minutes to over an hour |
In both, a gradient (HPLC) or temperature ramp (GC) speeds up the late peaks and keeps them sharp, so a whole chromatogram has peaks of similar width.
Other kinds of chromatogram
- Size-exclusion (SEC) or gel permeation (GPC) chromatogram. Molecules are separated by size, not by how strongly they stick: the largest leave first. Used for proteins (aggregates come out before the monomer) and polymers, where a calibration with size standards turns retention time into molecular weight.
- Ion chromatogram. Ion chromatography separates charged species, such as chloride, nitrate and sulfate in water, usually with a conductivity detector.
- Total ion chromatogram (TIC) and extracted ion chromatogram (EIC or XIC). In GC-MS and LC-MS, the mass spectrometer records a full spectrum many times a second. The TIC adds up all the ions at each moment. An extracted ion chromatogram plots only the signal at one mass-to-charge ratio, which pulls a target compound out of a crowded or co-eluting background.
- DNA sequencing chromatogram. In Sanger sequencing by capillary electrophoresis, each of the four bases carries a different fluorescent dye, so the trace has four coloured lines, one per base. Each peak is a DNA fragment one base longer than the last, and the colour of the tallest peak at each position is the base call. Strictly, it is an electropherogram, since the separation is by electrophoresis, but "chromatogram" and "trace file" are common names for it.
Baseline drift and noise
A real baseline has two problems, and they are handled differently.
- Drift is a slow change in the baseline over the run: a gradient changing the mobile phase's absorbance in HPLC, column bleed as a GC oven heats up, or a detector warming up. It moves the start and end of each integration line, so it changes the areas, especially of wide, low peaks.
- Noise is the fast random wobble on top. It sets the smallest peak you can see. A common rule is that a peak is detectable at a signal-to-noise ratio of about 3 and can be measured reliably at about 10 (see signal-to-noise ratio).
Smoothing the trace with a low-pass filter, such as a moving average or a Savitzky-Golay filter, reduces noise, but a filter that is too strong widens narrow peaks and cuts their height. Keep the filter narrow compared with the narrowest peak. Data systems often smooth only to find the peaks, and integrate the raw signal.
Common chromatogram mistakes
Most chromatogram mistakes come from treating peak heights, areas or a single clean-looking peak as more than they are.
- Reading height as amount. Two peaks of the same height can hold very different amounts if one is wider. Compare areas, and use a calibration, not the raw numbers.
- Treating area % as weight %. Detectors respond differently to different compounds. A UV detector barely sees a compound with no chromophore. Area % is only a weight % after correcting each peak by its response factor.
- Missing co-elution. A symmetric single peak can still hold two compounds with the same retention time. Check the peak's purity with a diode-array or mass spectrometer, or run a second method with different selectivity.
- Identifying by retention time alone. Retention times shift with column age, temperature, mobile phase batch and flow. Always compare with a standard run in the same sequence.
- Careless integration baselines. Dropping a perpendicular from the valley, skimming a small peak off a large one's tail, or drawing one baseline under a whole cluster can change a small peak's area by tens of per cent. Pick the rule the method specifies, apply it to standards and samples alike, and look at the integration lines, not just the table.
- Over-smoothing. Heavy smoothing makes a trace look clean but merges close peaks and lowers small ones.
- Ignoring the solvent front and system peaks. Peaks at , or that appear in a blank injection too, aren't sample compounds.
How to plot a chromatogram in JavaScript, React or Angular
Chromatography data systems record thousands of readings per run, and a GC-MS or LC-MS file holds a full spectrum at each of them. The demo below simulates a 12-minute HPLC run of five compounds, 6,000 detector readings on a drifting, noisy baseline, and every time you move a control it regenerates the run, finds the peaks, integrates them and labels each retention time.
Move the column temperature to shift the peaks: compounds B and C move at different rates and swap places near 45 °C, passing through complete co-elution. Column efficiency sets the plate number, and with it the peak widths. Peak shape adds tailing or fronting, Noise sets the detector noise, and Integrate peaks shades each peak's area down to its baseline and shows the peak table, with retention time, height, area, area % and the resolution to the next peak. Use the mouse wheel to zoom in on a small peak, drag to pan, double-click to see the whole run, and hover to read the signal.
Here is the code for this chart. Peak finding and integration are plain JavaScript; SciChart.js draws the signal, shades the integrated areas with band series and labels the peaks with annotations.
- JavaScript
- React
- Angular
// Find, label and integrate the peaks in a chromatogram, and chart it with SciChart.js
const {
SciChartSurface,
NumericAxis,
NumberRange,
EAutoRange,
FastLineRenderableSeries,
FastBandRenderableSeries,
XyDataSeries,
XyyDataSeries,
TextAnnotation,
VerticalLineAnnotation,
ECoordinateMode,
EHorizontalAnchorPoint,
EVerticalAnchorPoint,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier,
ZoomExtentsModifier
} = SciChart;
// or, for npm, import { SciChartSurface, ... } from "scichart"
// --- Peak integration helpers (plain JavaScript, no library needed) ---
function movingAverage(values, window) {
const half = Math.floor(window / 2);
const out = new Array(values.length);
let sum = 0;
let n = 0;
for (let i = -half; i < values.length; i++) {
if (i + half < values.length) { sum += values[i + half]; n++; }
if (i - half - 1 >= 0) { sum -= values[i - half - 1]; n--; }
if (i >= 0) out[i] = sum / n;
}
return out;
}
// Detector noise (standard deviation) from the median absolute difference between neighbouring readings
function estimateNoise(values) {
const diffs = [];
for (let i = 1; i < values.length; i++) diffs.push(Math.abs(values[i] - values[i - 1]));
diffs.sort((a, b) => a - b);
return diffs[Math.floor(diffs.length / 2)] / (0.6745 * Math.SQRT2);
}
// A rough baseline for finding peaks: fit a cubic, lower every point that is above the fit, and repeat
// (the "modified polynomial" method), so the peaks stop pulling the curve up
function estimateBaseline(x, values) {
const lo = x[0];
const hi = x[x.length - 1];
const u = x.map((t) => (2 * (t - lo)) / (hi - lo) - 1);
let work = values.slice();
let fit = values.slice();
for (let iteration = 0; iteration < 40; iteration++) {
const m = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]; // normal equations
for (let i = 0; i < u.length; i++) {
const p = [1, u[i], u[i] ** 2, u[i] ** 3];
for (let r = 0; r < 4; r++) {
for (let c = 0; c < 4; c++) m[r][c] += p[r] * p[c];
m[r][4] += p[r] * work[i];
}
}
for (let r = 0; r < 4; r++) {
for (let s = r + 1; s < 4; s++) {
const f = m[s][r] / m[r][r];
for (let c = r; c < 5; c++) m[s][c] -= f * m[r][c];
}
}
const coef = [0, 0, 0, 0];
for (let r = 3; r >= 0; r--) {
let sum = m[r][4];
for (let c = r + 1; c < 4; c++) sum -= m[r][c] * coef[c];
coef[r] = sum / m[r][r];
}
fit = u.map((v) => coef[0] + coef[1] * v + coef[2] * v * v + coef[3] * v * v * v);
work = work.map((v, i) => Math.min(v, fit[i]));
}
return fit;
}
// Find the peaks, split overlapping ones at the valley between them (a perpendicular drop), draw a straight
// baseline under each group, and measure retention time, height, area and width at half height.
function integratePeaks(x, y, startTime) {
const dtSeconds = (x[1] - x[0]) * 60;
const smooth = movingAverage(y, 9);
const noise = estimateNoise(y);
const baseline = estimateBaseline(x, smooth);
const above = smooth.map((v, i) => v - baseline[i]);
const first = x.findIndex((t) => t >= startTime);
// 1. Groups of readings clearly above the baseline, widened until they return to it
const groups = [];
const threshold = Math.max(6 * noise, 0.5);
for (let i = first; i < y.length; i++) {
if (above[i] <= threshold) continue;
let start = i;
let end = i;
while (end + 1 < y.length && above[end + 1] > threshold) end++;
while (start > first && above[start - 1] > 2 * noise) start--;
while (end + 1 < y.length && above[end + 1] > 2 * noise) end++;
const last = groups[groups.length - 1];
if (last && start <= last.end) last.end = end;
else groups.push({ start, end });
i = end;
}
// 2. Apexes in each group: local maxima that stand out from the valleys either side
const peaks = [];
for (const group of groups) {
const apexes = [];
for (let i = group.start + 1; i < group.end; i++) {
if (!(smooth[i] > smooth[i - 1] && smooth[i] >= smooth[i + 1])) continue;
let left = smooth[i];
for (let j = i - 1; j >= group.start && smooth[j] <= smooth[i]; j--) left = Math.min(left, smooth[j]);
let right = smooth[i];
for (let j = i + 1; j <= group.end && smooth[j] <= smooth[i]; j++) right = Math.min(right, smooth[j]);
if (smooth[i] - Math.max(left, right) > Math.max(5 * noise, 0.3)) apexes.push(i);
}
if (apexes.length === 0) continue;
// The baseline under the group: a straight line from its start to its end (valley to valley)
const y0 = smooth[group.start];
const slope = (smooth[group.end] - y0) / (x[group.end] - x[group.start]);
const line = (i) => y0 + slope * (x[i] - x[group.start]);
// Split the group at the lowest point between neighbouring apexes
const cuts = [group.start];
for (let a = 1; a < apexes.length; a++) {
let valley = apexes[a - 1];
for (let j = apexes[a - 1]; j <= apexes[a]; j++) if (smooth[j] < smooth[valley]) valley = j;
cuts.push(valley);
}
cuts.push(group.end);
apexes.forEach((apex, a) => {
const from = cuts[a];
const to = cuts[a + 1];
let area = 0;
for (let i = from; i < to; i++) area += ((y[i] - line(i) + y[i + 1] - line(i + 1)) / 2) * dtSeconds;
const height = smooth[apex] - line(apex);
// Refine the apex time with a parabola through the three highest readings
const [p, c, n] = [smooth[apex - 1], smooth[apex], smooth[apex + 1]];
const shift = (p - n) / (2 * (p - 2 * c + n)) || 0;
const crossing = (level, direction) => {
for (let i = apex; i > from && i < to; i += direction) {
const v0 = smooth[i] - line(i);
const v1 = smooth[i + direction] - line(i + direction);
if (v1 < level) return x[i] + ((v0 - level) / (v0 - v1)) * (x[i + direction] - x[i]);
}
return NaN; // the peak doesn't fall that low before the next one starts
};
const halfWidth = crossing(height / 2, 1) - crossing(height / 2, -1);
peaks.push({ from, to, line, apex, apexY: smooth[apex], retentionTime: x[apex] + shift * (x[1] - x[0]), height, area, halfWidth });
});
}
// Resolution to the next peak, from the widths at half height: Rs = 1.18 (tR2 - tR1) / (w0.5,1 + w0.5,2)
const totalArea = peaks.reduce((sum, peak) => sum + peak.area, 0);
peaks.forEach((peak, i) => {
const next = peaks[i + 1];
peak.percentArea = (100 * peak.area) / totalArea;
peak.resolution = next ? (1.18 * (next.retentionTime - peak.retentionTime)) / (peak.halfWidth + next.halfWidth) : NaN;
});
return { peaks, noise };
}
// --- The chart: detector signal against time ---
const { sciChartSurface, wasmContext } = await SciChartSurface.create(ui.chartDiv, {
theme: new SciChartJsNavyTheme()
});
sciChartSurface.xAxes.add(
new NumericAxis(wasmContext, {
axisTitle: "Retention time (min)",
visibleRange: new NumberRange(0, RUN_MINUTES),
labelPrecision: 1
})
);
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
axisTitle: "Detector response (mAU)",
autoRange: EAutoRange.Always,
growBy: new NumberRange(0.05, 0.15),
labelPrecision: 0
})
);
const PEAK_FILLS = ["#F48420", "#AE418D", "#67BDAF", "#F5E663", "#EC0F6C", "#50C7E0"];
const MAX_SHADED_PEAKS = 8;
// One band series per peak shades the area between the signal and the integration baseline
const shades = [];
for (let i = 0; i < MAX_SHADED_PEAKS; i++) {
const band = new FastBandRenderableSeries(wasmContext, {
dataSeries: new XyyDataSeries(wasmContext, { dataSeriesName: `Peak ${i + 1}` }),
fill: PEAK_FILLS[i % PEAK_FILLS.length] + "88",
fillY1: PEAK_FILLS[i % PEAK_FILLS.length] + "88",
stroke: "#00000000",
strokeY1: "#FFFFFFAA",
strokeThickness: 1,
isVisible: false
});
shades.push(band);
sciChartSurface.renderableSeries.add(band);
}
const signal = new XyDataSeries(wasmContext, {
dataSeriesName: "Detector signal",
dataIsSortedInX: true,
dataEvenlySpacedInX: true
});
sciChartSurface.renderableSeries.add(
new FastLineRenderableSeries(wasmContext, { dataSeries: signal, stroke: "#E8F1FF", strokeThickness: 1.5 })
);
sciChartSurface.chartModifiers.add(
new CursorModifier({ showTooltip: true, showAxisLabels: false }),
new MouseWheelZoomModifier(),
new ZoomPanModifier(),
new ZoomExtentsModifier()
);
// --- The controls ---
function onControlsChanged() {
const temperature = Number(ui.temperatureInput.value);
const plates = Math.round(1000 * Math.pow(30, Number(ui.platesInput.value) / 100) / 100) * 100; // 1,000 to 30,000, log scale
ui.temperatureOutput.textContent = `${temperature.toFixed(1)} °C`;
ui.platesOutput.textContent = `N = ${plates.toLocaleString("en-GB")}`;
const { x, y, truth } = simulateChromatogram(temperature, plates, ui.shapeSelect.value, ui.noiseSelect.value);
signal.clear();
signal.appendRange(x, y);
const { peaks } = integratePeaks(x, y, INTEGRATE_FROM);
const integrate = ui.integrateCheckbox.checked;
// Shade each peak's area down to its baseline
shades.forEach((band, i) => {
const peak = peaks[i];
band.isVisible = integrate && !!peak;
if (!band.isVisible) return;
const xs = [];
const ys = [];
const baselineYs = [];
for (let j = peak.from; j <= peak.to; j++) {
xs.push(x[j]);
ys.push(y[j]);
baselineYs.push(peak.line(j));
}
band.dataSeries.clear();
band.dataSeries.appendRange(xs, ys, baselineYs);
});
// Label the injection, the dead time t0 and each peak's retention time
sciChartSurface.annotations.clear();
for (const { time, label, top } of [{ time: 0, label: "Injection", top: 0.08 }, { time: DEAD_TIME, label: "t0 (dead time)", top: 0.02 }]) {
sciChartSurface.annotations.add(
new VerticalLineAnnotation({ x1: time, stroke: "#C8D3E8", strokeDashArray: [4, 4] }),
new TextAnnotation({
x1: time,
y1: top,
yCoordinateMode: ECoordinateMode.Relative,
text: label,
fontSize: 12,
textColor: "#C8D3E8",
xCoordShift: 4
})
);
}
for (const peak of peaks) {
sciChartSurface.annotations.add(
new TextAnnotation({
x1: peak.retentionTime,
y1: peak.apexY,
text: peak.retentionTime.toFixed(2),
fontSize: 13,
textColor: "#FFFFFF",
horizontalAnchorPoint: EHorizontalAnchorPoint.Center,
verticalAnchorPoint: EVerticalAnchorPoint.Bottom,
yCoordShift: -6
})
);
}
// The peak table, and a one-line summary
const cell = "padding:2px 6px; text-align:right; border-bottom:1px solid #3a5480;";
const fmt = (v, digits) => (Number.isFinite(v) ? v.toFixed(digits) : "–");
ui.table.style.display = integrate ? "block" : "none";
ui.table.innerHTML =
`<table style="border-collapse:collapse; width:100%"><caption style="text-align:left; padding-bottom:4px">` +
`Peak table</caption><thead><tr>` +
["Peak", "tR (min)", "Height (mAU)", "Area (mAU·s)", "Area %", "Rs to next"]
.map((h) => `<th scope="col" style="${cell}">${h}</th>`).join("") +
`</tr></thead><tbody>` +
peaks.map((p, i) =>
`<tr><td style="${cell}">${i + 1}</td><td style="${cell}">${fmt(p.retentionTime, 2)}</td>` +
`<td style="${cell}">${fmt(p.height, 1)}</td><td style="${cell}">${fmt(p.area, 0)}</td>` +
`<td style="${cell}">${fmt(p.percentArea, 1)}</td><td style="${cell}">${fmt(p.resolution, 2)}</td></tr>`
).join("") +
`</tbody></table>`;
// The simulation knows the true retention times, so it can say why a compound has no peak of its own
const owner = truth.map((c) => peaks.findIndex((p) => c.tR >= x[p.from] && c.tR <= x[p.to]));
const coeluting = owner.some((o, i) => o >= 0 && owner.indexOf(o) !== i);
const lost = owner.includes(-1);
const criticalRs = Math.min(...peaks.map((p) => p.resolution).filter(Number.isFinite));
ui.summary.textContent =
`${truth.length} compounds injected, ${peaks.length} peaks found` +
(Number.isFinite(criticalRs) ? ` · lowest Rs ${criticalRs.toFixed(2)}` : "") +
(coeluting ? " · co-elution: one peak hides two compounds" : "") +
(lost ? " · a peak is lost in the noise" : "");
}
ui.temperatureInput.addEventListener("input", onControlsChanged);
ui.platesInput.addEventListener("input", onControlsChanged);
ui.shapeSelect.addEventListener("change", onControlsChanged);
ui.noiseSelect.addEventListener("change", onControlsChanged);
ui.integrateCheckbox.addEventListener("change", onControlsChanged);
onControlsChanged();
import { SciChartReact } from "scichart-react";
import {
SciChartSurface,
NumericAxis,
NumberRange,
EAutoRange,
FastLineRenderableSeries,
FastBandRenderableSeries,
XyDataSeries,
XyyDataSeries,
TextAnnotation,
EHorizontalAnchorPoint,
EVerticalAnchorPoint,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier,
ZoomExtentsModifier
} from "scichart";
// initChart builds the chart; SciChartReact creates it, sizes it and cleans it up
const initChart = async (rootElement: string | HTMLDivElement) => {
const { wasmContext, sciChartSurface } = await SciChartSurface.create(rootElement, {
theme: new SciChartJsNavyTheme()
});
sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { axisTitle: "Retention time (min)" }));
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
axisTitle: "Detector response (mAU)",
autoRange: EAutoRange.Always,
growBy: new NumberRange(0.05, 0.15)
})
);
// Detector readings, and the peaks your data system found: retention time, apex, start, end, baseline
const { times, response } = getYourChromatogramData();
const peaks = getYourIntegratedPeaks();
// Shade each peak between the signal and its integration baseline
for (const peak of peaks) {
const shade = new XyyDataSeries(wasmContext, {
xValues: times.slice(peak.from, peak.to + 1),
yValues: response.slice(peak.from, peak.to + 1),
y1Values: peak.baseline // one baseline value per reading, from peak.from to peak.to
});
sciChartSurface.renderableSeries.add(
new FastBandRenderableSeries(wasmContext, {
dataSeries: shade,
fill: "#F4842077",
fillY1: "#00000000",
stroke: "#00000000",
strokeY1: "#FFFFFFAA"
})
);
sciChartSurface.annotations.add(
new TextAnnotation({
x1: peak.retentionTime,
y1: peak.apexResponse,
text: peak.retentionTime.toFixed(2),
textColor: "#FFFFFF",
horizontalAnchorPoint: EHorizontalAnchorPoint.Center,
verticalAnchorPoint: EVerticalAnchorPoint.Bottom,
yCoordShift: -6
})
);
}
sciChartSurface.renderableSeries.add(
new FastLineRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, { xValues: times, yValues: response }),
stroke: "#E8F1FF",
strokeThickness: 1.5
})
);
sciChartSurface.chartModifiers.add(
new CursorModifier({ showTooltip: true }),
new MouseWheelZoomModifier(),
new ZoomPanModifier(),
new ZoomExtentsModifier()
);
return { sciChartSurface };
};
export const ChromatogramChart = () => (
<SciChartReact initChart={initChart} style={{ width: "100%", height: 400 }} />
);
import { Component } from "@angular/core";
import { ScichartAngularComponent } from "scichart-angular";
import {
SciChartSurface,
NumericAxis,
NumberRange,
EAutoRange,
FastLineRenderableSeries,
FastBandRenderableSeries,
XyDataSeries,
XyyDataSeries,
TextAnnotation,
EHorizontalAnchorPoint,
EVerticalAnchorPoint,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier,
ZoomExtentsModifier
} from "scichart";
@Component({
selector: "app-chromatogram-chart",
standalone: true,
imports: [ScichartAngularComponent],
template: `<scichart-angular [initChart]="initChart" style="display: block; width: 100%; height: 400px"></scichart-angular>`
})
export class ChromatogramChartComponent {
// initChart builds the chart; scichart-angular creates it, sizes it and cleans it up
initChart = async (rootElement: string | HTMLDivElement) => {
const { wasmContext, sciChartSurface } = await SciChartSurface.create(rootElement, {
theme: new SciChartJsNavyTheme()
});
sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { axisTitle: "Retention time (min)" }));
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
axisTitle: "Detector response (mAU)",
autoRange: EAutoRange.Always,
growBy: new NumberRange(0.05, 0.15)
})
);
// Detector readings, and the peaks your data system found: retention time, apex, start, end, baseline
const { times, response } = getYourChromatogramData();
const peaks = getYourIntegratedPeaks();
// Shade each peak between the signal and its integration baseline
for (const peak of peaks) {
const shade = new XyyDataSeries(wasmContext, {
xValues: times.slice(peak.from, peak.to + 1),
yValues: response.slice(peak.from, peak.to + 1),
y1Values: peak.baseline // one baseline value per reading, from peak.from to peak.to
});
sciChartSurface.renderableSeries.add(
new FastBandRenderableSeries(wasmContext, {
dataSeries: shade,
fill: "#F4842077",
fillY1: "#00000000",
stroke: "#00000000",
strokeY1: "#FFFFFFAA"
})
);
sciChartSurface.annotations.add(
new TextAnnotation({
x1: peak.retentionTime,
y1: peak.apexResponse,
text: peak.retentionTime.toFixed(2),
textColor: "#FFFFFF",
horizontalAnchorPoint: EHorizontalAnchorPoint.Center,
verticalAnchorPoint: EVerticalAnchorPoint.Bottom,
yCoordShift: -6
})
);
}
sciChartSurface.renderableSeries.add(
new FastLineRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, { xValues: times, yValues: response }),
stroke: "#E8F1FF",
strokeThickness: 1.5
})
);
sciChartSurface.chartModifiers.add(
new CursorModifier({ showTooltip: true }),
new MouseWheelZoomModifier(),
new ZoomPanModifier(),
new ZoomExtentsModifier()
);
return { sciChartSurface };
};
}
Key points:
- The signal is a
FastLineRenderableSeriesover anXyDataSeries, with time in minutes on the x-axis. The y-axis usesEAutoRange.Always, so it rescales as the controls change the peak heights. - Each integrated peak is a
FastBandRenderableSeries: anXyyDataSeriesholds the signal asyand the integration baseline asy1, and the band fills the area between them. ThestrokeY1line shows where the baseline was drawn. - Retention times are
TextAnnotations anchored at the bottom centre, just above each apex; the injection and dead time areVerticalLineAnnotations with labels. - The peak finder smooths the signal, estimates the noise and a baseline, finds peaks that rise clearly above the noise, splits overlapping ones at the valley between them, and sums the area above a straight baseline drawn under each group.
See it in the demo app: JavaScript mountain chart · React mountain chart · Angular mountain chart, and for labelled peaks, JavaScript chart annotations · React chart annotations · Angular chart annotations.
Go deeper: SciChart.js band series documentation, the mountain (area) series documentation and the line series documentation. For how laboratories use SciChart for instrument and analysis software, see SciChart for diagnostics and life sciences.
Frequently asked questions
What does a chromatogram show?
A chromatogram shows the detector's signal against time after a sample is injected into a chromatography column. Each peak is a compound, or a group of compounds, leaving the column. The time of the peak's top (its retention time) helps identify the compound, and the area under the peak tells you how much of it there is.
Where is the retention time on a chromatogram?
The retention time is read on the horizontal axis. It is the time from the injection (time zero) to the top of a peak. Data systems print it above each peak and list it in the peak table. Subtract the dead time, the retention time of an unretained compound, to get the adjusted retention time.
What is the difference between a chromatogram and a chromatograph?
A chromatograph is the instrument that performs the separation, such as a gas chromatograph or an HPLC system. A chromatogram is the record it produces: a plot of detector response against time. Chromatography is the technique itself.
Should I use peak height or peak area to measure the amount?
Use peak area in most cases. The area stays the same when a peak gets wider, for example later in a run or on an older column, while the height falls. Height can be better for a small peak on a noisy or sloping baseline, or a peak that overlaps its neighbour, as long as the standards and samples are run under the same conditions.
What resolution is good enough between two peaks?
A resolution of 1.5 or more is usually called baseline resolution: two equal Gaussian peaks then overlap by only about 0.1%. At a resolution of 1.0 the overlap is about 2%, which is enough for many qualitative checks but can bias the areas. Many validated methods require at least 1.5, or 2.0, for the critical pair.
How do I plot a chromatogram in JavaScript?
Load the detector readings as time and response arrays into a line series, with time in minutes on the x-axis. Add text annotations for the retention times, shade each integrated peak between the signal and its baseline with a band series, and add zoom, pan and a cursor so analysts can inspect small peaks. SciChart.js does this with FastLineRenderableSeries, FastBandRenderableSeries and TextAnnotation.
Sources
- United States Pharmacopeia, General Chapter <621> Chromatography (harmonised with the European Pharmacopoeia 2.2.46 and the Japanese Pharmacopoeia). Definitions of retention time, dead time, resolution, plate number, the symmetry (tailing) factor and system suitability.
- Harvey, D., Analytical Chemistry 2.1, LibreTexts: General theory of column chromatography, optimising chromatographic separations, gas chromatography and high-performance liquid chromatography.
- Snyder, L. R., Kirkland, J. J. and Dolan, J. W. (2010), Introduction to Modern Liquid Chromatography, 3rd edition, Wiley. Resolution, the Purnell equation, peak tailing and integration.
- Skoog, D. A., Holler, F. J. and Crouch, S. R. (2018), Principles of Instrumental Analysis, 7th edition, Cengage. Chromatographic theory, detectors, GC and HPLC.
- Sanger, F., Nicklen, S. and Coulson, A. R. (1977), DNA sequencing with chain-terminating inhibitors. Proceedings of the National Academy of Sciences, 74(12). The chain-termination method behind sequencing traces.
- Smith, L. M. et al. (1986), Fluorescence detection in automated DNA sequence analysis. Nature, 321(6071). Four fluorescent dyes, one per base: the four-colour trace.
- International Council for Harmonisation (2023), ICH Q2(R2): Validation of Analytical Procedures. Signal-to-noise ratios of about 3 for detection and 10 for quantitation.
- Lieber, C. A. and Mahadevan-Jansen, A. (2003), Automated method for subtraction of fluorescence from biological Raman spectra. Applied Spectroscopy, 57(11). The iterative polynomial baseline used by the demo's peak finder.