Skip to content

Plotting

Navi Stream provides two plotting statements for rendering chart elements: plot and hline.

Both plot and hline can only be used at the top-level scope. They cannot be used inside functions.

plot

plot draws a data series on the chart. It takes one required positional argument (the value to plot) and several optional named arguments.

Syntax

nvs

Arguments

ArgumentTypeRequiredDefaultDescription
valuenumberYesThe numeric value to plot.
titlestringNoThe display name of the series in the legend.
colorcolorNoThe color of the series. Can be a color literal (e.g. #red, #ff8d1e) or a variable.
styleplotstyleNoplotstyle.lineThe drawing style of the series.
keystringNoA unique identifier for the series, used for programmatic reference.
hiddenboolNofalseIf true, the series is hidden by default.
format_numberboolNofalseIf true, the value will be formatted with number formatting (e.g. thousand separators).

Plot Styles

The plotstyle enum provides the following styles:

ValueDescription
plotstyle.lineDraws a line chart (default).
plotstyle.histogramDraws a histogram (bar) chart.
plotstyle.circlesDraws individual circle markers.
plotstyle.stickDraws vertical stick lines.

Examples

Basic line plot:

nvs

Multiple series with different colors:

nvs

Dynamic color with a variable:

nvs

Using different plot styles:

nvs

Hidden series:

nvs

hline

hline draws a horizontal line at a fixed value on the chart. It is typically used to mark reference levels such as overbought/oversold thresholds.

Syntax

nvs

Arguments

ArgumentTypeRequiredDefaultDescription
valuenumberYesThe y-axis value at which to draw the horizontal line.
colorcolorNoThe color of the line.
stylelinestyleNolinestyle.solidThe line drawing style.
widthnumberNoThe width of the line.
show_labelboolNofalseIf true, displays the value label on the line.

Line Styles

The linestyle enum provides the following styles:

ValueDescription
linestyle.solidDraws a solid line (default).
linestyle.dashDraws a dashed line.

Examples

Simple horizontal line:

nvs

Marking overbought and oversold levels:

nvs

Using solid line style:

nvs