Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Candlestick Chart 3D

Signature

sp.build_candlestick3d_chart(
    title: str,
    dates: list[str],
    opens: list[float],
    highs: list[float],
    lows: list[float],
    closes: list[float],
    *,
    color_up: int = 0x22c55e,
    color_down: int = 0xef4444,
    bg_color: str = "#1a1a2e",
    width: int = 1000,
    height: int = 600,
    x_label: str = "",
    y_label: str = "",
    z_label: str = "",
    hover_json: str | None = None,
) -> Chart

Aliases: sp.candlestick3d


Description

OHLC candlestick chart rendered in 3D WebGL. Candles are extruded as 3D prisms.


Parameters

ParameterTypeDefaultDescription
titlestrrequiredChart title
dateslist[str]requiredDate labels
openslist[float]requiredOpen prices
highslist[float]requiredHigh prices
lowslist[float]requiredLow prices
closeslist[float]requiredClose prices
color_upint0x22c55eBullish candle color
color_downint0xef4444Bearish candle color
bg_colorstr"#1a1a2e"Background
widthint1000Canvas width
heightint600Canvas height

Returns

Chart


Examples

import seraplot as sp
chart = sp.build_candlestick3d_chart(
    "BTC/USD 3D",
    labels=["Mon", "Tue", "Wed", "Thu", "Fri"],
    open= [42000, 43500, 41800, 44000, 45200],
    high= [44000, 44200, 43500, 46000, 47000],
    low=  [41500, 43000, 40000, 43500, 44800],
    close=[43500, 41800, 44000, 45200, 46500],
)
const sp = require('seraplot');
const chart = sp.build_candlestick3d_chart("BTC/USD 3D",
["Mon", "Tue", "Wed", "Thu", "Fri"],
[42000, 43500, 41800, 44000, 45200],
[44000, 44200, 43500, 46000, 47000],
[41500, 43000, 40000, 43500, 44800],
{
    close: [43500, 41800, 44000, 45200, 46500]
})
import * as sp from 'seraplot';
const chart = sp.build_candlestick3d_chart("BTC/USD 3D",
["Mon", "Tue", "Wed", "Thu", "Fri"],
[42000, 43500, 41800, 44000, 45200],
[44000, 44200, 43500, 46000, 47000],
[41500, 43000, 40000, 43500, 44800],
{
    close: [43500, 41800, 44000, 45200, 46500]
})
▶ Live Preview

See also

Signature

sp.build_candlestick3d_chart(
    title: str,
    dates: list[str],
    opens: list[float],
    highs: list[float],
    lows: list[float],
    closes: list[float],
    *,
    color_up: int = 0x22c55e,
    color_down: int = 0xef4444,
    bg_color: str = "#1a1a2e",
    width: int = 1000,
    height: int = 600,
    x_label: str = "",
    y_label: str = "",
    z_label: str = "",
    hover_json: str | None = None,
) -> Chart

Aliases: sp.candlestick3d


Description

Graphique bougie OHLC rendu en WebGL 3D. Les bougies sont extrudées comme des prismes 3D.


Paramètres

ParamètreTypeDéfautDescription
titlestrrequisTitre du graphique
dateslist[str]requisÉtiquettes de dates
openslist[float]requisPrix d'ouverture
highslist[float]requisPrix hauts
lowslist[float]requisPrix bas
closeslist[float]requisPrix de clôture
color_upint0x22c55eCouleur des bougies haussières
color_downint0xef4444Couleur des bougies baissières
bg_colorstr"#1a1a2e"Couleur de fond
widthint1000Largeur du canvas
heightint600Hauteur du canvas

Retourne

Chart


Exemples

import seraplot as sp

chart = sp.build_candlestick3d_chart(
    "BTC/USD 3D",
    labels=["Lun", "Mar", "Mer", "Jeu", "Ven"],
    open= [42000, 43500, 41800, 44000, 45200],
    high= [44000, 44200, 43500, 46000, 47000],
    low=  [41500, 43000, 40000, 43500, 44800],
    close=[43500, 41800, 44000, 45200, 46500],
)

Voir aussi