Drawing styles for plot(), as plot.style_* values, and line styles for plot.linestyle_* values: line, columns, histogram, area, circles and more.
plot.style_* constants go in the style argument of plot(). plot.style_line draws a continuous line and is the default. plot.style_linebr leaves a gap where the value is na. plot.style_stepline and plot.style_steplinebr hold the value flat until the next change, and plot.style_stepline_diamond adds a marker at each step. plot.style_histogram and plot.style_columns draw bars from a base level (histbase, 0 by default); plot.style_area and plot.style_areabr fill down to that base; plot.style_circles and plot.style_cross draw one dot or cross per bar and no line.
plot.linestyle_solid, plot.linestyle_dashed and plot.linestyle_dotted are the three values of plot()'s linestyle argument, available in Pine v6. They apply to the line-type styles.
Constants
| Name | Value | Description |
|---|---|---|
plot.linestyle_dashed | Dashed line for plot()'s linestyle argument. | |
plot.linestyle_dotted | Dotted line for plot()'s linestyle argument. | |
plot.linestyle_solid | Solid line for plot()'s linestyle argument. | |
plot.style_area | A line with the area down to the base level filled. | |
plot.style_areabr | Like the area style, with a gap wherever the value is na. | |
plot.style_circles | A circle at each bar's value, with no connecting line. | |
plot.style_columns | A column from the base level to the value on each bar. | |
plot.style_cross | A cross at each bar's value, with no connecting line. | |
plot.style_histogram | A thin vertical bar from the base level to the value. | |
plot.style_line | A continuous line through the values; the default. | |
plot.style_linebr | A line with a gap wherever the value is na. | |
plot.style_stepline | A line that holds each value flat until it changes. | |
plot.style_stepline_diamond | A step line with a diamond marker at each change. | |
plot.style_steplinebr | A step line with a gap wherever the value is na. |
Remarks
- Pick
plot.style_linebrorplot.style_areabrwhen a series has na stretches you want to show as gaps; the others connect across them. plot.style_columnsignores the line width and uses the bar width;plot.style_histogramuses the line width as its bar thickness.- On Sidechair: histogram and columns both draw as a histogram, area and areabr draw as a filled area, and the remaining styles draw as a line with step or dot options. plot() ignores its linestyle argument, so the three plot.linestyle_* constants change nothing.
Example
//@version=6
indicator("Plot styles")
change = ta.change(close)
plot(change, "Change", change >= 0 ? color.green : color.red, style = plot.style_columns)
plot(ta.sma(close, 20) - close, "Distance", color.blue, 2, plot.style_stepline)
plot(ta.rsi(close, 14) - 50, "RSI", color.new(color.purple, 50), style = plot.style_area)See also
Runs on Sidechair