Class CandlestickRenderer
java.lang.Object
com.arbergashi.charts.render.BaseRenderer
com.arbergashi.charts.render.financial.CandlestickRenderer
- All Implemented Interfaces:
ChartRenderer
CandlestickRenderer - Professional OHLC Visualization
Enterprise-grade candlestick renderer for financial data visualization with proper OHLC (Open-High-Low-Close) representation.
Performance Characteristics:
- Render Time: ~0.2ms per candle
- Memory: Zero allocations (shape pooling)
- Typical: 2500 candles in
< 500ms - Clipping: Skips off-screen candles
Visual Style:
- Bullish (Close > Open): Green candle, gradient fill
- Bearish (Close < Open): Red candle, gradient fill
- Wicks: Thin line from high to low
- Body: Rectangle from open to close (rounded)
- Since:
- 2025-06-01
- Version:
- 1.0.0
- Author:
- Arber Gashi
-
Field Summary
Fields inherited from class BaseRenderer
PIXEL_BUF, PIXEL_BUF4 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawData(Graphics2D g, ChartModel model, PlotContext context) Implementation-specific drawing logic.getPointAt(Point2D pixel, ChartModel model, PlotContext context) Returns the data index nearest to the given pixel coordinate, if supported.setCompressGaps(boolean compressGaps) Enables optional gap compression (e.g., hide non-trading periods).Methods inherited from class BaseRenderer
drawHighlightPoint, drawI18nLabel, drawLabel, getArc, getCachedFont, getCachedGradient, getCachedStroke, getCachedStroke, getCachedStroke, getCubicCurve, getEllipse, getId, getLayerIndex, getLegendColor, getLine, getName, getPathCache, getRect, getRoundRectangle, getSeriesColor, getSeriesStroke, getTheme, getTooltipText, isLegendRequired, isMultiColor, pBuffer, pBuffer4, render, resolveTheme, seriesOrBase, setLayerIndex, setMultiColor, setTheme, setupQualityHints, themeAccent, themeAxisLabel, themeBackground, themeBearish, themeBullish, themeForeground, themeGrid, themeSeriesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChartRenderer
clearHover, createContext, getFocusValues, getPreferredYRange, renderEmptyState, supportsEmptyState
-
Constructor Details
-
CandlestickRenderer
public CandlestickRenderer()
-
-
Method Details
-
setCompressGaps
Enables optional gap compression (e.g., hide non-trading periods). -
drawData
Description copied from class:BaseRendererImplementation-specific drawing logic. Must follow Zero-Allocation rules.- Specified by:
drawDatain classBaseRenderer
-
getPointAt
Description copied from class:BaseRendererReturns the data index nearest to the given pixel coordinate, if supported.- Specified by:
getPointAtin interfaceChartRenderer- Overrides:
getPointAtin classBaseRenderer- Parameters:
pixel- mouse/crosshair position in component coordinatesmodel- data model for this layercontext- current plot context- Returns:
- optional point index
-