Skip to content

useKlinechartsUISettings

Manage chart appearance: candle type, colors, price marks, axes, grid, crosshair and tooltips.

const settings = useKlinechartsUISettings();
FieldTypeDefaultDescription
candleTypestring"candle_solid"Candle display type
candleUpColorstring"#2DC08E"Bullish candle color
candleDownColorstring"#F92855"Bearish candle color
showLastPricebooleantrueLast price mark on Y-axis
showHighPricebooleantrueHigh price mark
showLowPricebooleantrueLow price mark
showIndicatorLastValuebooleantrueIndicator last value mark
priceAxisTypePriceAxisType"normal"Y-axis scale type
reverseCoordinatebooleanfalseInvert Y-axis
showTimeAxisbooleantrueShow X-axis
showGridbooleantrueShow grid
showCrosshairbooleantrueShow crosshair
showCandleTooltipbooleantrueOHLCV tooltip
showIndicatorTooltipbooleantrueIndicator tooltip

Candle types: candle_solid, candle_stroke, candle_up_stroke, candle_down_stroke, ohlc, area. Price axis types: "normal", "percentage", "log".

FieldTypeDescription
candleTypesCandleTypeItem[]{ key, localeKey } list for a selector
priceAxisTypes{ key: PriceAxisType; localeKey: string }[]List for a selector

Each field has a setter: setCandleType, setCandleUpColor, setCandleDownColor, setShowLastPrice, setShowHighPrice, setShowLowPrice, setShowIndicatorLastValue, setPriceAxisType, setReverseCoordinate, setShowTimeAxis, setShowGrid, setShowCrosshair, setShowCandleTooltip, setShowIndicatorTooltip. All apply immediately via chart.setStyles(...).

MethodDescription
resetToDefaults()Reset all settings via chart.setStyles(theme)