Volume profile
Prices with the volume traded at each level on the side, and the busiest level marked. Good for finding the prices where most of the trading happened.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'volumeprofile',
data: [
{ label: '1 Jan', open: 121, close: 119.7, high: 121.8, low: 117.7, volume: 391 },
{ label: '2 Jan', open: 119.7, close: 114.4, high: 122.2, low: 112.2, volume: 536 },
{ label: '3 Jan', open: 114.4, close: 110.8, high: 115.4, low: 109.8, volume: 1723 },
{ label: '4 Jan', open: 110.8, close: 104.2, high: 113.4, low: 104, volume: 860 },
{ label: '5 Jan', open: 104.2, close: 100.6, high: 105.3, low: 97.6, volume: 225 },
{ label: '6 Jan', open: 100.6, close: 99.9, high: 103, low: 98, volume: 1525 },
{ label: '7 Jan', open: 99.9, close: 95.6, high: 101.6, low: 93.4, volume: 1602 },
{ label: '8 Jan', open: 95.6, close: 91.8, high: 97.9, low: 90.3, volume: 290 },
{ label: '9 Jan', open: 91.8, close: 95.9, high: 97.2, low: 89.9, volume: 1728 },
{ label: '10 Jan', open: 95.9, close: 101.7, high: 103.2, low: 95.2, volume: 1381 },
{ label: '11 Jan', open: 101.7, close: 100.3, high: 103.7, low: 98.1, volume: 721 },
{ label: '12 Jan', open: 100.3, close: 108.1, high: 109.6, low: 99.2, volume: 578 },
{ label: '13 Jan', open: 108.1, close: 101.5, high: 109.3, low: 101.2, volume: 771 },
{ label: '14 Jan', open: 101.5, close: 105, high: 107.3, low: 99.5, volume: 1378 },
{ label: '15 Jan', open: 105, close: 99.5, high: 106, low: 97.1, volume: 1408 },
{ label: '16 Jan', open: 99.5, close: 102.5, high: 105.9, low: 97.8, volume: 1553 },
{ label: '17 Jan', open: 102.5, close: 104.5, high: 107, low: 99.2, volume: 715 },
{ label: '18 Jan', open: 104.5, close: 102.2, high: 108.4, low: 100.8, volume: 1429 },
{ label: '19 Jan', open: 102.2, close: 104.9, high: 108.4, low: 101.5, volume: 372 },
{ label: '20 Jan', open: 104.9, close: 110.7, high: 113.1, low: 101, volume: 1453 },
{ label: '21 Jan', open: 110.7, close: 105.8, high: 113.9, low: 103.7, volume: 602 },
{ label: '22 Jan', open: 105.8, close: 109.1, high: 111, low: 104.5, volume: 1694 },
{ label: '23 Jan', open: 109.1, close: 107.9, high: 109.4, low: 106.6, volume: 1698 },
{ label: '24 Jan', open: 107.9, close: 112.4, high: 114.2, low: 104.7, volume: 997 },
{ label: '25 Jan', open: 112.4, close: 106.4, high: 112.9, low: 103.8, volume: 1001 },
{ label: '26 Jan', open: 106.4, close: 107, high: 109.5, low: 105, volume: 1067 },
{ label: '27 Jan', open: 107, close: 108.1, high: 111.1, low: 103.2, volume: 723 },
{ label: '28 Jan', open: 108.1, close: 109.2, high: 109.9, low: 107.1, volume: 1345 },
{ label: '1 Feb', open: 109.2, close: 112.3, high: 113.6, low: 108.7, volume: 1185 },
{ label: '2 Feb', open: 112.3, close: 115.2, high: 117.8, low: 109.4, volume: 1487 },
{ label: '3 Feb', open: 115.2, close: 109.1, high: 118.7, low: 106.8, volume: 556 },
{ label: '4 Feb', open: 109.1, close: 104.6, high: 113.1, low: 100.9, volume: 1306 },
{ label: '5 Feb', open: 104.6, close: 100, high: 106.9, low: 96.2, volume: 419 },
{ label: '6 Feb', open: 100, close: 102.3, high: 105.2, low: 97.7, volume: 1765 },
{ label: '7 Feb', open: 102.3, close: 99.6, high: 103.9, low: 95.7, volume: 1674 },
{ label: '8 Feb', open: 99.6, close: 96, high: 102.6, low: 94.5, volume: 1792 },
{ label: '9 Feb', open: 96, close: 91.1, high: 96.8, low: 90.7, volume: 1406 },
{ label: '10 Feb', open: 91.1, close: 93.1, high: 96.9, low: 89.1, volume: 1503 },
{ label: '11 Feb', open: 93.1, close: 99.4, high: 100.3, low: 90.8, volume: 1682 },
{ label: '12 Feb', open: 99.4, close: 96.9, high: 100.8, low: 93, volume: 1439 },
{ label: '13 Feb', open: 96.9, close: 101, high: 104, low: 94.2, volume: 289 },
{ label: '14 Feb', open: 101, close: 96.5, high: 104.3, low: 93.7, volume: 634 },
{ label: '15 Feb', open: 96.5, close: 97.3, high: 101, low: 93.2, volume: 348 },
{ label: '16 Feb', open: 97.3, close: 90.6, high: 99.4, low: 88.7, volume: 1782 },
{ label: '17 Feb', open: 90.6, close: 86.4, high: 93.9, low: 83.1, volume: 1618 },
{ label: '18 Feb', open: 86.4, close: 87.6, high: 90.7, low: 83.9, volume: 1542 },
{ label: '19 Feb', open: 87.6, close: 93.3, high: 94.4, low: 85.7, volume: 1708 },
{ label: '20 Feb', open: 93.3, close: 86.8, high: 94.4, low: 82.8, volume: 958 },
{ label: '21 Feb', open: 86.8, close: 94.1, high: 95.1, low: 86.3, volume: 344 },
{ label: '22 Feb', open: 94.1, close: 94.6, high: 95.7, low: 92.6, volume: 633 },
{ label: '23 Feb', open: 94.6, close: 96.8, high: 99, low: 92.4, volume: 1401 },
{ label: '24 Feb', open: 96.8, close: 103.1, high: 106, low: 93.7, volume: 1765 },
{ label: '25 Feb', open: 103.1, close: 110.6, high: 112.4, low: 100.1, volume: 480 },
{ label: '26 Feb', open: 110.6, close: 104.2, high: 113.6, low: 101.7, volume: 1189 },
{ label: '27 Feb', open: 104.2, close: 102.6, high: 105.1, low: 100.9, volume: 627 },
{ label: '28 Feb', open: 102.6, close: 102.4, high: 103.8, low: 100.4, volume: 240 },
{ label: '1 Mar', open: 102.4, close: 106.6, high: 109.2, low: 99.4, volume: 819 },
{ label: '2 Mar', open: 106.6, close: 110.6, high: 114.3, low: 103.3, volume: 1654 },
{ label: '3 Mar', open: 110.6, close: 106.8, high: 112.2, low: 104.1, volume: 416 },
{ label: '4 Mar', open: 106.8, close: 103.9, high: 108.6, low: 100.7, volume: 270 },
{ label: '5 Mar', open: 103.9, close: 99.8, high: 105.2, low: 97.3, volume: 1664 },
{ label: '6 Mar', open: 99.8, close: 103.2, high: 104.5, low: 97, volume: 281 },
{ label: '7 Mar', open: 103.2, close: 98.8, high: 105.6, low: 96.2, volume: 773 },
{ label: '8 Mar', open: 98.8, close: 99.6, high: 102.9, low: 97.7, volume: 894 },
{ label: '9 Mar', open: 99.6, close: 94.5, high: 101, low: 91.1, volume: 1307 },
{ label: '10 Mar', open: 94.5, close: 100.2, high: 103.2, low: 91.7, volume: 1630 },
{ label: '11 Mar', open: 100.2, close: 105.6, high: 106.4, low: 98.7, volume: 278 },
{ label: '12 Mar', open: 105.6, close: 103.2, high: 109.4, low: 101, volume: 318 },
{ label: '13 Mar', open: 103.2, close: 106.2, high: 109.4, low: 100.5, volume: 591 },
{ label: '14 Mar', open: 106.2, close: 110.9, high: 113.8, low: 105.3, volume: 1195 },
],
candles: true,
};
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 volumeprofile takes:
/** Prices with the volume traded at each price level on the side; the busiest level is the point of control. */
interface VolumeProfileSpec extends Base {
type: 'volumeprofile';
data: Candle[];
/** Price levels of the profile; 24 by default. */
bins?: number;
/** Candles instead of a line of closes. */
candles?: boolean;
color?: string;
up?: string;
down?: string;
}
interface Candle {
label: string;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