Skip to content

v3.29.8

Latest

Choose a tag to compare

@graphieros graphieros released this 28 Nov 13:59

VueUiCandlestick: optional volume pane

VueUiCandlestick can now show trading volume as a bar chart in its own pane, below the price chart and its time axis.

image
  • Opt-in: the pane is hidden by default. Existing charts look exactly the same until you set style.layout.volume.show: true.
  • Candle colors: by default each bar uses its candle's bullish or bearish color. Set useCandleColors: false to use a single color instead.
  • Max volume label: a label next to the y-axis labels shows the highest visible volume. It supports prefix, suffix, roundingValue and a formatter.
  • Themes: every built-in theme sets matching volume colors.

Configuration

const config = {
    style: {
        layout: {
            volume: {
                show: true, // default: false
                heightRatio: 0.1, // share of the plot height used by the volume pane, clamped between 0.05 and 0.8
                gap: 12, // space in px between the price time axis and the volume pane
                widthRatio: null, // bar width as a share of the slot; null follows style.layout.candle.widthRatio
                borderRadius: 1,
                useCandleColors: true, // use the bullish/bearish candle colors
                color: '#A1A1A1', // used when useCandleColors is false
                opacity: 50, // 0 - 100
                dataLabels: {
                    show: true, // max volume label
                    fontSize: 8,
                    color: '#2D353C',
                    bold: false,
                    offsetX: 0,
                    roundingValue: 0,
                    prefix: '',
                    suffix: '',
                    formatter: null, // ({ value, config }) => string | number
                },
            },
        },
    },
};
<VueUiCandlestick :dataset="dataset" :config="config" />

TypeScript users get these options through the VueUiCandlestickConfig type, under style.layout.volume.

Docs are up to date