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
| Parameter | Type | Default | Description |
|---|---|---|---|
title | str | required | Chart title |
dates | list[str] | required | Date labels |
opens | list[float] | required | Open prices |
highs | list[float] | required | High prices |
lows | list[float] | required | Low prices |
closes | list[float] | required | Close prices |
color_up | int | 0x22c55e | Bullish candle color |
color_down | int | 0xef4444 | Bearish candle color |
bg_color | str | "#1a1a2e" | Background |
width | int | 1000 | Canvas width |
height | int | 600 | Canvas 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ètre | Type | Défaut | Description |
|---|---|---|---|
title | str | requis | Titre du graphique |
dates | list[str] | requis | Étiquettes de dates |
opens | list[float] | requis | Prix d'ouverture |
highs | list[float] | requis | Prix hauts |
lows | list[float] | requis | Prix bas |
closes | list[float] | requis | Prix de clôture |
color_up | int | 0x22c55e | Couleur des bougies haussières |
color_down | int | 0xef4444 | Couleur des bougies baissières |
bg_color | str | "#1a1a2e" | Couleur de fond |
width | int | 1000 | Largeur du canvas |
height | int | 600 | Hauteur 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],
)