Skip to content
Financial & quantitativeGenerated from the public API

EfficientFrontierChart

Read a market, a risk or a return, with the axis and the tooltip wired for the job.

@luc/ui/charts

What it shows

Place assets and a supplied efficient frontier in risk-return space to compare portfolio choices.

Live preview

The frontier is supplied as ordered points: LUC draws the optimisation result, it does not solve one.

<EfficientFrontierChart
  assets={[
    { label: "Equity", risk: 16, expectedReturn: 8 },
    { label: "Credit", risk: 9, expectedReturn: 5.2 },
    { label: "Rates", risk: 5.5, expectedReturn: 2.8 },
    { label: "Gold", risk: 13, expectedReturn: 4.5 },
    { label: "Cash", risk: 0.4, expectedReturn: 1.9 },
  ]}
  frontier={[
    { risk: 2, expectedReturn: 2.4 },
    { risk: 5, expectedReturn: 3.9 },
    { risk: 8, expectedReturn: 5.1 },
    { risk: 11, expectedReturn: 6.1 },
    { risk: 14, expectedReturn: 7 },
    { risk: 17, expectedReturn: 7.8 },
  ]}
  current={{ label: "Current", risk: 10, expectedReturn: 5.5 }}
  riskFormat={{ kind: "percent", decimals: 0 }}
  returnFormat={{ kind: "percent", decimals: 0 }}
  height={340}
  ariaLabel="Risk against return"
/>

Controls

Height

340px

A chart measures its container, so it always needs a definite height.

State

The surface the chart is in — loading, empty and error are drawn by the component.

Accessible name

A drawing is not readable by a screen reader, so it needs a name that states what it shows.

The same fixture as the live preview above; the controls change how it is drawn, not what it measures.

Code
import { EfficientFrontierChart } from "@luc/ui/charts";

<EfficientFrontierChart
  assets={[
    { label: "Equity", risk: 16, expectedReturn: 8 },
    { label: "Credit", risk: 9, expectedReturn: 5.2 },
    { label: "Rates", risk: 5.5, expectedReturn: 2.8 },
    { label: "Gold", risk: 13, expectedReturn: 4.5 },
    { label: "Cash", risk: 0.4, expectedReturn: 1.9 },
  ]}
  frontier={[
    { risk: 2, expectedReturn: 2.4 },
    { risk: 5, expectedReturn: 3.9 },
    { risk: 8, expectedReturn: 5.1 },
    { risk: 11, expectedReturn: 6.1 },
    { risk: 14, expectedReturn: 7 },
    { risk: 17, expectedReturn: 7.8 },
  ]}
  current={{ label: "Current", risk: 10, expectedReturn: 5.5 }}
  riskFormat={{ kind: "percent", decimals: 0 }}
  returnFormat={{ kind: "percent", decimals: 0 }}
  height={340}
  ariaLabel="Risk against return"
  state="ready"
/>

Not controllable here

  • series / rows — The numbers are the caller's; the fixture above is the example.
Copy for an AI agentA specification an agent can act on: the import, the setup, the chosen props, the data contract and the accessibility expectation.
Implement `EfficientFrontierChart` from Luc UI. It is: Read a market, a risk or a return, with the axis and the tooltip wired for the job.

Import it with: import { EfficientFrontierChart } from "@luc/ui/charts";
Requires: react ^19.0.0; react-dom ^19.0.0; react-hook-form ^7.0.0 (optional, for @luc/ui/forms/react-hook-form); tailwindcss ^4.0.0; node >= 22 (repository tools). Import the stylesheet once at the app root and wrap the tree in `LucProvider`. Both come from the package that publishes @luc.

Chosen configuration: `height={340}`, `state="ready"`, `ariaLabel="Risk against return"`.

Accessibility: keep the component's own semantics. Do not re-implement its ARIA wiring, do not add roles it does not declare, and make sure every interactive element is reachable and operable from the keyboard with a visible focus state.
Styling: use Luc UI design tokens and the component's own props. Do not restyle with raw colour literals and do not override the component's internal structure with page CSS.
Motion: respect `prefers-reduced-motion`. The component already does, so do not disable it.

Reproduce this state:
```tsx
<EfficientFrontierChart
  assets={[
    { label: "Equity", risk: 16, expectedReturn: 8 },
    { label: "Credit", risk: 9, expectedReturn: 5.2 },
    { label: "Rates", risk: 5.5, expectedReturn: 2.8 },
    { label: "Gold", risk: 13, expectedReturn: 4.5 },
    { label: "Cash", risk: 0.4, expectedReturn: 1.9 },
  ]}
  frontier={[
    { risk: 2, expectedReturn: 2.4 },
    { risk: 5, expectedReturn: 3.9 },
    { risk: 8, expectedReturn: 5.1 },
    { risk: 11, expectedReturn: 6.1 },
    { risk: 14, expectedReturn: 7 },
    { risk: 17, expectedReturn: 7.8 },
  ]}
  current={{ label: "Current", risk: 10, expectedReturn: 5.5 }}
  riskFormat={{ kind: "percent", decimals: 0 }}
  returnFormat={{ kind: "percent", decimals: 0 }}
  height={340}
  ariaLabel="Risk against return"
  state="ready"
/>
```

Usage

The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.

It is drawn by the ECharts engine.

Worked examples with real data are on the family overview: Financial & quantitative

import { EfficientFrontierChart } from "@luc/ui/charts";
<EfficientFrontierChart
  assets={[
    { label: "Equity", risk: 16, expectedReturn: 8 },
    { label: "Credit", risk: 9, expectedReturn: 5.2 },
    { label: "Rates", risk: 5.5, expectedReturn: 2.8 },
    { label: "Gold", risk: 13, expectedReturn: 4.5 },
    { label: "Cash", risk: 0.4, expectedReturn: 1.9 },
  ]}
  frontier={[
    { risk: 2, expectedReturn: 2.4 },
    { risk: 5, expectedReturn: 3.9 },
    { risk: 8, expectedReturn: 5.1 },
    { risk: 11, expectedReturn: 6.1 },
    { risk: 14, expectedReturn: 7 },
    { risk: 17, expectedReturn: 7.8 },
  ]}
  current={{ label: "Current", risk: 10, expectedReturn: 5.5 }}
  riskFormat={{ kind: "percent", decimals: 0 }}
  returnFormat={{ kind: "percent", decimals: 0 }}
  height={340}
  ariaLabel="Risk against return"
/>

Data contract

`assets` contain label/risk/expectedReturn; `frontier` is an ordered risk-return path; `current` is one labelled point. Risk and return must already be computed in compatible units.

Important configuration

Format both axes with the caller's percent or decimal convention, keep the frontier order, and explain whether returns are arithmetic or compounded.

Guidelines

When not to use

Do not imply that LUC solves the optimisation or validates the frontier; the efficient set is an input from the research process.

Configuration

Exported symbols
ExportKindSignature
EfficientFrontierChart15 documented props({ assets, frontier, current, riskFormat, returnFormat, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: EfficientFrontierChartProps) => import("@…

EfficientFrontierChart props

Type: EfficientFrontierChartProps

Values the compiler reads from the declaration.

EfficientFrontierChart props
PropTypeDefaultNotes
ariaDescription?string | undefined—
ariaLabel?string | undefined—
assetsreadonly FrontierPoint[]—Individual assets or portfolios.
className?string | undefined—
current?FrontierPoint | undefined—The currently held portfolio.
description?string | undefined—
eager?boolean | undefined—Create the engine on mount rather than when the surface is approached.
frontier?readonly FrontierPoint[] | undefined—The efficient frontier itself, ordered by risk.
height?string | number | undefined—
onEvent?((event: EChartEvent) => void) | undefined—
onReady?((chart: EChartsInstance) => void) | undefined—
returnFormat?ChartFormat | undefined—
riskFormat?ChartFormat | undefined—
state?ChartState | undefined—
title?string | undefined—

Accessibility

A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.

What happens on the server, and when hydration changes it.

Luc UI v1.0EfficientFrontierChartdark theme