Tank farm
Storage tanks in 3D, each filled to its level, as wide as its capacity. Good for depots, terminals and refineries: what is stored and where there is room.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
import 'nervure/themes';
const spec = {
type: 'tankfarm',
data: [
{ name: 'T-101', product: 'Crude', capacity: 80000, volume: 43200 },
{ name: 'T-102', product: 'Crude', capacity: 80000, volume: 34400 },
{ name: 'T-201', product: 'Gasoline', capacity: 40000, volume: 9200 },
{ name: 'T-202', product: 'Diesel', capacity: 50000, volume: 25500 },
{ name: 'T-203', product: 'Diesel', capacity: 50000, volume: 9500 },
{ name: 'T-301', product: 'Jet fuel', capacity: 30000, volume: 5400 },
],
};
export default function Example() {
return <Chart spec={spec} style={{ height: 340 }} />;
}Or import this chart alone: what each import weighs.
Options
Beside the fields shared by every chart (title, format, heading, export…), type tankfarm takes:
/** Storage tanks seen from the side, filled to their level. */
interface TankFarmSpec extends Base {
type: 'tankfarm';
/** `volume` and `capacity` in the unit (m³ by default). */
data: { name: string; volume: number; capacity: number; product?: string; color?: string }[];
unit?: string;
/** Where the eye stands, in degrees. */
view?: { azimuth?: number; elevation?: number };
onItemClick?: (name: string) => void;
}Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More