Plotting & Visualization
Functions for rendering data on charts with customizable styling, colors, and visual effects. Create beautiful and informative visualizations for your technical indicators and market analysis.
Overview
Chart Rendering
Plot time series data directly onto charts with multiple style options including lines, splines, points, candles, and bars for comprehensive market visualization.
Visual Customization
Customize colors, line widths, fill areas, and smoothing options to create visually appealing and distinct indicators that stand out on your charts.
Advanced Effects
Apply advanced visual effects like momentum fills, smooth curves, and multi-layer plotting to create sophisticated technical analysis displays.
Functions Reference
plot - universal plotting function for all visualization types
plot(series: TimeSeries, type?: 'spline' | 'line' | 'bar' | 'candle' | 'point', colors?: string[], width?: number, fill?: boolean | 'momentum_fill', smooth?: boolean, showPriceDisplay?: boolean): void
Parameters:
- series (TimeSeries) - The data series to visualize
- type (string) - "spline"/"line" for lines, "bar" for histogram, "candle" for OHLC, "point" for dots
- colors (string[]) - Colors array - format depends on plot type and fill mode
- width (number) - Thickness of lines or size of bars/points (1-5)
- fill (boolean | 'momentum_fill') - true for area fill, "momentum_fill" for conditional coloring
- smooth (boolean) - Smooth line curves for better visual appeal
- showPriceDisplay (boolean) - Show current value in price scale (default: false)
Returns:
void (plots data on chart)
Code Example:
plotCandle - render OHLC data as candlestick charts
plotCandle(series: TimeSeries, colors?: color[] = ['orange', 'green'], width?: number = 1, showPriceDisplay?: boolean = false): void
Parameters:
- series (TimeSeries) - OHLC data series to plot as candlesticks
- colors (color[]) - Color array for bullish/bearish candles (default: ['orange', 'green'])
- width (number) - Candle width (default: 1)
- showPriceDisplay (boolean) - Show current value in price scale (default: false)
Returns:
void (plots candlestick chart)
Code Example:
plotBar - render OHLC data as traditional bar charts
plotBar(series: TimeSeries, colors?: color[] = ['orange', 'green'], width?: number = 1, showPriceDisplay?: boolean = false): void
Parameters:
- series (TimeSeries) - OHLC data series to plot as bars
- colors (color[]) - Color array for bullish/bearish bars (default: ['orange', 'green'])
- width (number) - Bar width (default: 1)
- showPriceDisplay (boolean) - Show current value in price scale (default: false)
Returns:
void (plots bar chart)
Code Example:
plotLine - render data as enhanced line charts
plotLine(series: TimeSeries, colors?: color[] = ['orange'], width?: number = 2, fill?: boolean | 'momentum_fill' | 'default' = false, smooth?: boolean = false, showPriceDisplay?: boolean = false): void
Parameters:
- series (TimeSeries) - Data series to plot as lines
- colors (color[]) - Color array for lines (default: ['orange'])
- width (number) - Line width (default: 2)
- fill (boolean | 'momentum_fill' | 'default') - Fill options for area under lines (default: false)
- smooth (boolean) - Enable smooth line rendering (default: false)
- showPriceDisplay (boolean) - Show current value in price scale (default: false)
Returns:
void (plots line chart)
Code Example:
plotShape - render custom shapes and markers on charts
plotShape(series: TimeSeries, shape: ShapeType, colors?: color[] = ['orange'], width?: number = 2, fill?: boolean | 'false' | 'momentum_fill' | 'default' = false, showPriceDisplay?: boolean = false): void
Parameters:
- series (TimeSeries) - Data series for shape positioning
- shape (ShapeType) - Shape type to plot (e.g., 'circle', 'triangle', 'square')
- colors (color[]) - Color array for shapes (default: ['orange'])
- width (number) - Shape border width (default: 2)
- fill (boolean | 'false' | 'momentum_fill' | 'default') - Fill options for shapes (default: false)
- showPriceDisplay (boolean) - Show current value in price scale (default: false)
Returns:
void (plots shapes on chart)
Code Example:
Common Usage Patterns
Candlestick Price Chart
Display OHLC price data using candlestick visualization with price display
Traditional Bar Chart
Display OHLC data as traditional bar charts with custom colors and price display
Enhanced Line Plotting
Use plotLine for smooth moving averages with momentum fills and price display
Momentum Fill Visualization
Create filled areas that change color based on momentum with price display
Best Practices
Color Selection
Use contrasting colors for different data series. Consider color-blind accessibility when choosing color schemes for your indicators.
Line Width
Use thicker lines (3-4) for primary indicators and thinner lines (1-2) for secondary data. This creates visual hierarchy in your charts.
Smooth Curves
Enable smooth curves for continuous data like moving averages, but use straight lines for discrete signals or step functions.
Candlestick Colors
Use traditional green/red or green/red color schemes for candlesticks. Green typically represents bullish (closing higher) and red represents bearish (closing lower).
Shape Positioning
When using plotShape for signals, position markers slightly above or below price action to avoid overlapping with the main chart data.
Chart Types
Use plotCandle for price action analysis, plotBar for traditional OHLC display, plotLine for indicators, and plotShape for discrete signals and annotations.