PlotLine
Renders a line chart by connecting data points with straight lines.Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable containing the data
Name of the plot
Index of the data in the PineData array to plot
Plot styling options including color, linewidth, fillgaps, etc.
Z-index depth for layering (optional)
Example
Notes
- Gaps in data are handled based on
options.fillgaps - When
fillgapsis true, connects across missing values - When
fillgapsis false, creates separate line segments
PlotLine.tsx:18-86
PlotKline
Renders candlestick, bar, or line charts for OHLC (Open-High-Low-Close) data.Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable containing kline/candlestick data
Chart style:
'candle', 'bar', or 'line'Z-index depth for layering
KlineKind Types
Traditional candlestick chart with hollow/filled rectangles
OHLC bar chart with horizontal ticks
Line chart connecting close prices
Example
Rendering Details
Candle Style: Renders rectangles for the body (open to close) with wicks extending to high/low. Positive candles (close > open) and negative candles (close < open) use different CSS classes. Bar Style: Renders vertical lines from high to low with horizontal ticks for open (left) and close (right). Line Style: Connects the close prices with a continuous line, showing min/max range when bars are compressed. Source:PlotKline.tsx:17-233
PlotHistogram
Renders vertical bars from zero to the data value, commonly used for volume or oscillator indicators.Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable containing the data
Name of the plot
Index of the data in the PineData array to plot
Plot styling options (color can be dynamic per bar)
Z-index depth for layering (optional)
Example
Dynamic Coloring
Histogram bars can have different colors based on the data. The color is read fromdata.options.color if available, allowing per-bar color customization.
Source: PlotHistogram.tsx:19-82
PlotHline
Renders a horizontal line at a constant value across the chart.Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable (value is read from first available bar)
Name of the horizontal line
Index of the data in the PineData array
Plot options including color and linestyle
Z-index depth for layering (optional)
Line Styles
Solid continuous line (default)
Dashed line with 4-3 pattern
Dotted line with 1-2 pattern
Example
PlotHline.tsx:19-74
PlotShape
Renders various shapes and markers at specific chart locations (above/below bars, top/bottom).Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable with boolean values indicating when to show shapes
Name of the plot
Index of the data in the PineData array
Options including color, shape, location, and optional text
Z-index depth for layering (optional)
Shape Types
X-shaped cross marker
Plus-shaped cross marker
Filled circle
Upward-pointing triangle
Downward-pointing triangle
Upward-pointing arrow
Downward-pointing arrow
Label with upward-pointing arrow, supports text
Label with downward-pointing arrow, supports text
Flag shape
Filled square
Filled diamond
Location Types
Above the bar’s high price
Below the bar’s low price
Top of the chart pane
Bottom of the chart pane
Example
PlotShape.tsx:23-314
PlotFill
Fills the area between two plot lines with a solid color.Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable containing both plots to fill between
Name of the fill
Options including plot1, plot2 (indices), color, and fillgaps
Z-index depth for layering (optional)
Required Options
Index of the first plot to fill from
Index of the second plot to fill to
Fill color
Example
PlotFill.tsx:18-129
PlotBgcolor
Colors the background of individual bars/candles based on data values.Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable containing color data
Name of the background plot
Index of the data in the PineData array
Plot options (color is read from data)
Z-index depth for layering (optional)
Example
Notes
- Color is dynamically read from
data.options.colorfor each bar - Creates rectangular backgrounds spanning the full chart height
- Useful for highlighting market conditions or trends
PlotBgcolor.tsx:20-58
PlotVolume
Location:src/lib/charting/plot/PlotVolume.tsx
Renders trading volume as a histogram with positive and negative bars based on price movement.
Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable containing Kline (OHLCV) data
Z-index depth for layering (optional)
Example
Rendering Details
- Positive bars (close >= open): Rendered with
className="positive" - Negative bars (close < open): Rendered with
className="negative" - Bar width: Auto-adjusts based on available space
- Compression: Displays maximum volume when multiple bars are compressed
- Bars are drawn from zero to the volume value
PlotVolume.tsx:14-80
PlotStepLine
Location:src/lib/charting/plot/PlotStepLine.tsx
Renders a step line chart where values change in discrete steps rather than diagonal lines.
Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable with numeric values
Name of the plot
Index of the data in the PineData array
Options including color and display settings
Z-index depth for layering (optional)
Example
Notes
- Creates horizontal and vertical line segments (no diagonals)
- Horizontal segment extends to the right edge of the bar
- Vertical segment drawn at right edge when value changes
- Useful for displaying discrete state changes
PlotStepLine.tsx:18-103
PlotCrossCircles
Location:src/lib/charting/plot/PlotCrossCircles.tsx
Renders markers as either circles or crosses at data points.
Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable with numeric values
Name of the plot
Index of the data in the PineData array
Options including color and style (‘style_circles’ or ‘style_cross’)
Z-index depth for layering (optional)
Marker Styles
Renders filled circles at each data point
Renders cross markers at each data point
Example
Notes
- Circle radius adapts to bar width (minimum 3px)
- Cross markers have fixed size based on bar width
- Useful for highlighting specific data points or signals
PlotCrossCircles.tsx:20-94
PlotDrawingLine
Location:src/lib/charting/plot/PlotDrawingLine.tsx
Renders dynamic lines from PineScript’s line drawing API, supporting lines created at runtime.
Props
X-axis control for horizontal positioning
Y-axis control for vertical positioning
Time series variable containing LineObject arrays
Name of the plot
Index of the data in the PineData array
Plot options
Z-index depth for layering (optional)
LineObject Interface
Each line is defined by a LineObject with these properties:Unique identifier for the line
X-coordinate of start point (bar index or time)
Y-coordinate of start point (price value)
X-coordinate of end point
Y-coordinate of end point
Coordinate system for x values
Line color
Line style
Line width in pixels
Example
Line Styles
style_solid: Continuous linestyle_dashed: Dashed line (4px dash, 3px gap)style_dotted: Dotted line (1px dot, 2px gap)
Notes
- Supports both time-based and bar-index-based coordinates
- Multiple lines can share the same ID (will be merged)
- Used by PineScript’s
line.new()function
PlotDrawingLine.tsx:18-86
PlotOptions Interface
Common options interface used by all plot types.Properties
Internal plot identifier
Series number for multi-series plots
Display title for the plot
First plot index (for fill operations)
Second plot index (for fill operations)
Plot color (hex, rgb, or named color)
Line thickness in pixels
Line style: ‘solid’, ‘dashed’, or ‘dotted’
Plot style: ‘line’, ‘style_histogram’, ‘style_columns’, ‘shape’, ‘hline’, ‘fill’, ‘background’, etc.
Whether to connect across missing data points
Shape type for PlotShape (see Shape Types above)
Location for shapes: ‘abovebar’, ‘belowbar’, ‘top’, ‘bottom’, ‘absolute’
Text to display with labels
Color for label text
Plot.ts:28-55