Gauge

Three independent indicators

Compare CPU load, availability and throughput in responsive panels.

Live demo

CPU load7272Availability99.9599.95Throughput383800101020203030404050506060

Configuration

With automatic layout, panels share a row when space allows. Use one column to compare them vertically.

Example code

Copy the example with its current settings.

JS/TS · TypeScript
import { ChartToolbarAction, ChartToolbarPosition } from '@neural-charts/web';
import { createChartPanels, type ChartPanelsData, type ChartPanelsOptions } from '@neural-charts/web/panels';

const data: ChartPanelsData = {
  "panels": [
    {
      "id": "load",
      "data": {
        "type": "gauge",
        "value": 72,
        "domain": [
          0,
          100
        ]
      }
    },
    {
      "id": "availability",
      "data": {
        "type": "gauge",
        "value": 99.95,
        "domain": [
          0,
          100
        ]
      }
    },
    {
      "id": "throughput",
      "data": {
        "type": "gauge",
        "value": 38,
        "domain": [
          0,
          60
        ]
      }
    }
  ]
};
const options: ChartPanelsOptions = {
  chart: {
    "animation": {
      "enabled": true
    },
    "locale": "en",
    "theme": "light",
    toolbar: {
      actions: [ChartToolbarAction.Csv, ChartToolbarAction.Png, ChartToolbarAction.Svg],
      position: ChartToolbarPosition.Top,
    }
  },
  "columns": "auto",
  "panels": {
    "load": {
      "title": "CPU load",
      "height": 180,
      "unit": "%",
      "layout": {
        "style": "solid",
        "preset": "arc"
      },
      "appearance": {
        "colors": [
          "#2C6DCD"
        ]
      }
    },
    "availability": {
      "title": "Availability",
      "height": 180,
      "unit": "%",
      "layout": {
        "style": "solid",
        "preset": "arc"
      },
      "appearance": {
        "colors": [
          "#638A35"
        ]
      }
    },
    "throughput": {
      "title": "Throughput",
      "height": 180,
      "unit": "req/s",
      "layout": {
        "style": "needle",
        "preset": "arc"
      },
      "appearance": {
        "colors": [
          "#8B6CCE"
        ]
      }
    }
  }
};
const host = document.createElement('div');
document.body.append(host);
const chart = createChartPanels(host, data, options, { instanceId: 'rollout' });
if (chart.status === 'invalid') throw new Error(chart.diagnostic.message);
export function dispose() { chart.value.destroy(); host.remove(); }

Data, options and events

Identify each panel and link X axes that share a domain. Apply common options and override them per panel.

ChartPanelsData

ChartPanelsOptions

ChartPanelsMountOptions