Carbon µPlot

CPU utilization — 24h

CPU utilization — single series

CPU utilization — legend top

CPU utilization — no legend

Disk I/O — custom series colors

Network throughput — value & tooltip time formatters

CPU utilization — 24h


import { createLineChart } from 'carbon-uplot';

createLineChart(el, {
  data: [timestamps, cpuSeriesA, cpuSeriesB, cpuSeriesC],
  yRange: [0, 100],
  series: [
    { label: 'prod-vsi-01' },
    { label: 'prod-vsi-02' },
    { label: 'prod-vsi-03' },
  ],
});

CPU utilization — single series


import { createLineChart } from 'carbon-uplot';

createLineChart(el, {
  data: [timestamps, cpuSeriesC],
  yRange: [0, 100],
  series: [{ label: 'CPU' }],
});

CPU utilization — legend top


import { createLineChart } from 'carbon-uplot';

createLineChart(el, {
  data: [timestamps, cpuSeriesA, cpuSeriesB, cpuSeriesC],
  yRange: [0, 100],
  series: [
    { label: 'prod-vsi-01' },
    { label: 'prod-vsi-02' },
    { label: 'prod-vsi-03' },
  ],
  legend: 'top',
});

CPU utilization — no legend


import { createLineChart } from 'carbon-uplot';

createLineChart(el, {
  data: [timestamps, cpuSeriesA, cpuSeriesB, cpuSeriesC],
  yRange: [0, 100],
  series: [
    { label: 'prod-vsi-01' },
    { label: 'prod-vsi-02' },
    { label: 'prod-vsi-03' },
  ],
  legend: false,
});

Disk I/O — custom series colors


import { createLineChart } from 'carbon-uplot';

createLineChart(el, {
  data: [timestamps, diskReads, diskWrites, diskAwait],
  yRange: [0, 350],
  series: [
    { label: 'reads/s', color: '#ff7eb6' },
    { label: 'writes/s', color: '#42be65' },
    { label: 'await (ms)', color: '#f1c21b' },
  ],
});

Network throughput — value & tooltip time formatters


import { createLineChart } from 'carbon-uplot';

function networkFormat(value) {
  if (value >= 1_048_576) return `${(value / 1_048_576).toFixed(1)} MB/s`;
  return `${(value / 1024).toFixed(0)} KB/s`;
}

createLineChart(el, {
  data: [timestamps, netInbound, netOutbound],
  series: [{ label: 'Inbound' }, { label: 'Outbound' }],
  valueFormat: networkFormat,
});