label
forge.drawfunctionSince Forge API 1
Signaturepython
forge.draw.label(bar: int | Point,price: float | None = None,text: str = '',*,style: Mapping[str, Any] | None = None,where: str | None = None,color: Color | str | None = None,text_color: Color | str | None = None,size: str | None = None,bold: bool | None = None,italic: bool | None = None,align: str | None = None,font: str | None = None,id: str | None = None) -> DrawingWrite text on the chart at a price (where="at_price") or on a bar.
Parameters
| Name | Type | Default |
|---|---|---|
| bar | int | Point | |
| price | float | None | None |
| text | str | '' |
| style | Mapping[str, Any] | None | None |
| where | str | None | None |
| color | Color | str | None | None |
| text_color | Color | str | None | None |
| size | str | None | None |
| bold | bool | None | None |
| italic | bool | None | None |
| align | str | None | None |
| font | str | None | None |
| id | str | None | None |
above_bar and below_bar labels sit on the bar and take no price. Defaults: where
"at_price", color theme.accent, text_color theme.text, size
"normal", bold and italic off, align "center", font "default".
style takes the same names as a mapping; a name is given once, in style or as a
keyword. Give id to draw the same label again: a live id replaces the earlier drawing.