Lattice Grid

blog

Radar Chart for Supplier Scorecards

Building…
Loading a live grid…

If you are the buyer choosing between suppliers, the question is rarely which one is cheapest. It is which one is strong where you need it and weak only where you can live with it: price, lead time, quality, responsiveness and compliance, all at once.

A radar chart answers that. Each criterion is a spoke, each supplier is a shape, and a score is how far along the spoke the shape reaches. The chart above is bound to the grid beneath it, one row per supplier and criterion, so filtering the rows redraws the chart. Filter the Supplier column down to the three you are shortlisting and the other shapes leave the picture.

Why a radar and not a bar chart

A grouped bar chart of five criteria and three suppliers gives you fifteen bars to compare one by one. A radar turns each supplier into a single shape, so you see at a glance that one is big and lopsided, another is smaller but even, and a third is thin only on price. It suits a handful of criteria on the same scale, which is what a scorecard is.

The chart over a grid

The criterion column is the spoke, the score column is the distance along it, and the supplier column splits the rows into one shape each. Radar is built in, so there is no extra module to import. Here is the example in plain JavaScript, with sample rows inline in place of your own.

import { createGrid } from '@toclocoinc/lattice-grid';
import '@toclocoinc/lattice-grid/css';
import { createChart } from '@toclocoinc/lattice-grid/modules/charts';

const suppliers = { 'Supplier A': [9, 5, 8, 6, 9], 'Supplier B': [6, 9, 7, 8, 7], 'Supplier C': [7, 7, 6, 9, 8] };
const criteria = ['Price', 'Lead time', 'Quality', 'Responsiveness', 'Compliance'];
const rows = Object.entries(suppliers).flatMap(([supplier, list]) =>
  list.map((score, i) => ({ id: `${supplier}-${i}`, supplier, criterion: criteria[i], score })));

const gridEl = document.createElement('div');
const chartEl = document.createElement('div');
gridEl.style.height = '240px';
chartEl.style.height = '420px';
document.body.append(gridEl, chartEl);

const grid = createGrid(gridEl, {
  rowKey: 'id', rows,
  columns: [
    { field: 'supplier', title: 'Supplier', filter: { type: 'set' } },
    { field: 'criterion', title: 'Criterion', filter: { type: 'set' } },
    { field: 'score', title: 'Score', type: 'number' },
  ],
});
createChart({ grid, container: chartEl, type: 'radar', x: 'criterion', y: 'score',
  series: 'supplier', legend: true, title: 'Supplier scorecard' });

The same thing in React

The React adapter is a factory, so you build the component once at module scope. The ref’s grid is the real grid, which is what the chart binds to.

import React, { useEffect, useRef } from 'react';
import { createGrid } from '@toclocoinc/lattice-grid';
import '@toclocoinc/lattice-grid/css';
import { createLatticeGrid } from '@toclocoinc/lattice-grid/modules/react';
import { createChart } from '@toclocoinc/lattice-grid/modules/charts';

const LatticeGrid = createLatticeGrid({ React, createGrid });
const suppliers = { 'Supplier A': [9, 5, 8, 6, 9], 'Supplier B': [6, 9, 7, 8, 7], 'Supplier C': [7, 7, 6, 9, 8] };
const criteria = ['Price', 'Lead time', 'Quality', 'Responsiveness', 'Compliance'];
const rows = Object.entries(suppliers).flatMap(([supplier, list]) =>
  list.map((score, i) => ({ id: `${supplier}-${i}`, supplier, criterion: criteria[i], score })));
const columns = [
  { field: 'supplier', title: 'Supplier', filter: { type: 'set' } },
  { field: 'criterion', title: 'Criterion' },
  { field: 'score', title: 'Score', type: 'number' },
];

export function SupplierRadar() {
  const gridRef = useRef(null);
  const chartRef = useRef(null);
  useEffect(() => {
    const chart = createChart({ grid: gridRef.current.grid, container: chartRef.current,
      type: 'radar', x: 'criterion', y: 'score', series: 'supplier', legend: true });
    return () => chart.destroy();
  }, []);
  return (<>
    <LatticeGrid ref={gridRef} rowKey="id" columns={columns} rows={rows} style={{ height: 200 }} />
    <div ref={chartRef} style={{ height: 360 }} />
  </>);
}

The options used

These are the rows of the charts reference for the options in the listings above.

Option Type What it does
grid Grid Required. The grid to read.
container Element or string Required. Where to draw.
type string 'radar' here, one spoke per category.
x string The category column, here the criterion, one spoke each.
y string The measure column, here the score.
series string Splits the measure into one series per distinct value, here one shape per supplier.
legend boolean or object Show the series legend.
title string Drawn above the plot.

Reading the scorecard

Look first at the size of each shape and then at its dips. In the example, Supplier A reaches far on price and compliance and falls short on lead time, so it suits a buyer who plans well ahead. Supplier C is smaller but even, which suits a buyer who cannot afford a bad surprise on any one criterion. Filter the Criterion column to drop a spoke you do not weigh, and clear it to bring it back.

Next

See the radar beside the other specialist charts in the specialist family demo, read the full list of chart types on the charts page, or follow the how-to for a chart that follows the grid.

Read next

  • Funnel Chart for a Sales Pipeline

    Bind a funnel chart to a grid of pipeline counts: leads, qualified, proposal, won. Filter the rows by region to redraw the drop at each stage.

  • Gauge Chart of Warehouse Utilisation

    Bind a gauge chart to a grid of warehouse zones and read utilisation against its bands. Filter the rows and the needle moves.

  • Force Tree Chart of Service Dependencies

    Bind a force tree chart to a grid of services and what each depends on, the hub at the centre. Filter the rows and the map redraws.

All posts RSS