FullChartConfig.md

September 4, 2023 ยท View on GitHub

FullChartConfig

The main configuration file for chart-core. Includes all components' configurations, global configs like dateFormatter, and colors.

PropertyDescriptionType
scaleControls how chart series are positioned horizontally and vertically. Other configurations like: inverse, lockRatio etc.ChartScale
componentsGroup of component configurations. Chart component is a single visual object on chart. Examples: chart itself, events, x-axis, highlights, cross tool.ChartComponents
colorsAll colors in chart-core are configured here.FullChartColors
dateFormatterDate and time formatting configuration.DateFormatter
timezoneTimezone to use on chart X axis labels and any other timestamps. Examples: Africa/Accra, Europe/Moscow, Asia/Tehran.string
fixedSizeIf set - chart canvas will have fixed size always.{ width: number; height: number; }
rtlRight to left mode. Used in drawings (like text drawing) calculation.boolean
drawingOrderInitial visual order of chart drawers. Reorder to put volumes on top of candles for example.`("MAIN_BACKGROUND"
useUTCTimeOverrideboolean
animationAnimationConfig
devexpertsPromoLinkboolean
shortDaysstring[]
shortMonthsstring[]

ChartScale

Controls how chart series are positioned horizontally and vertically. Other configurations like: inverse, lockRatio etc.

PropertyDescriptionType
autoAuto scale will always fit whole chart series in viewport.boolean
zoomToCursorTrue - will zoom to cursor on mouse wheel. False - zoom to last candle.boolean
lockPriceToBarRatioLocks the ratio between price/time, so when zooming it will feel like google maps.boolean
inverseInverses the Y scale vertically.boolean
autoScaleOnCandlesDo auto scale (even if it's not enabled in config) after instrument change.boolean
autoScaleDisableOnDragWhen dragging chart under specific angle - will automatically disable auto-scale.AutoScaleDisableOnDrag
zoomSensitivity0..1 ratio of full viewport; 0.5 = middle, 0.75 = 3/4 of viewportnumber
defaultViewportItemsDefines how much items (candles) will be in viewport when chart applies basic scalenumber
keepZoomXOnYAxisChangeAdjust x viewport when y-axis width is changed, so x zoom remains the sameboolean

AutoScaleDisableOnDrag

When dragging chart under specific angle - will automatically disable auto-scale.

PropertyDescriptionType
enabledboolean
edgeAngleThe angle of mouse movement. Default - Math.PI / 9.number
yDiffDistance that mouse should travel vertically in px. Default - 80.number

ChartComponents

Group of component configurations. Chart component is a single visual object on chart. Examples: chart itself, events, x-axis, highlights, cross tool.

PropertyDescriptionType
chartChartConfigComponentsChart
xAxisChartConfigComponentsXAxis
yAxisYAxisConfig
gridGridComponentConfig
volumesChartConfigComponentsVolumes
offsetsChartConfigComponentsOffsets
waterMarkChartConfigComponentsWaterMark
eventsChartConfigComponentsEvents
highLowChartConfigComponentsHighLow
crossToolChartConfigComponentsCrossTool
highlightsChartConfigComponentsHighlights
navigationMapChartConfigComponentsNavigationMap
baselineChartConfigComponentsBaseline
paneResizerHorizontal resizer between panesChartConfigComponentsPaneResizer

ChartConfigComponentsChart

PropertyDescriptionType
typeThe type of chart. Candle, bar, area and others.keyof BarTypes
showCandlesBorderShows the border of candle. Useful for hollow-candles and to increase contrast on thin candles.boolean
showActiveCandlesBorderShows the border for active candle (tapped by finger on mobile devices).boolean
showWicksShows candle wicks - high and low.boolean
candleLineWidthnumber
barLineWidthnumber
lineWidthnumber
areaLineWidthnumber
minCandlesThe minimum amount of candles in viewport. It will not be possible to make fewer than that by using zoom.number
defaultZoomCandleWidthnumber
minWidthnumber
zoomStepnumber
candlePaddingPercentnumber
highlightActiveCandleboolean
cursorstring
selectedWidthnumber
minCandlesOffsetnumber
histogramChartConfigComponentsHistogram

ChartConfigComponentsHistogram

PropertyDescriptionType
barCapSizenumber

ChartConfigComponentsXAxis

PropertyDescriptionType
visibleboolean
cursorstring
formatsForLabelsConfigRecord<TimeFormatWithDuration, string>
padding{ top?: number; bottom?: number; }
fontSizenumber
fontFamilystring
fontStylestring

YAxisConfig

PropertyDescriptionType
visibleboolean
typeType of Y axis. Currently supported 'regular', 'percent', 'logarithmic'.PriceAxisType
alignAlign Y axis left or right.YAxisAlign
labelsConfigures the labels on Y axis.YAxisLabels
typeConfigOverride appearance of different label types. Useful to change all labels of the same type.YAxisTypeConfig
labelHeightThe height of the single label in pixels. Used during calculation step between labels.
You can make it smaller to fit more labels on Y axis. Or less to fit less labels.number
zeroPercentLineAlways show zero line for percent scale.boolean
customScaleAllow to scale chart vertically by dragging Y axis with mouse.boolean
customScaleDblClickAllows to double-click on Y axis to turn on auto-scale.boolean
cursorstring
resizeDisabledCursorstring
labelBoxMargin{ top: number; bottom: number; end: number; start: number; }
fontSizenumber
fontFamilystring

YAxisLabels

Configures the labels on Y axis.

PropertyDescriptionType
descriptionsboolean
settingsSettings contains required labels ('lastPrice', 'countDownToBarClose') and optional labels ('bidAsk', 'highLow', 'prevDayClose', 'prePostMarket').Record<string, YAxisLabelConfig>

GridComponentConfig

PropertyDescriptionType
visibleboolean
verticalShows vertical grid lines.boolean
horizontalShows horizontal grid lines.boolean
widthWidth of grid lines in pixels.number
dashLine dash configuration like [1,2].number[]
colorstring

ChartConfigComponentsVolumes

PropertyDescriptionType
visibleboolean
showSeparatelyShow volumes in overlaying mode or as sub-chart like a study.boolean
volumeFillColorstring
valueLinesnumber
barCapSizenumber
volumeBarSpacenumber

ChartConfigComponentsOffsets

PropertyDescriptionType
visibleboolean
topTop offset, measured in percents of chart height.number
leftLeft offset, measured in amount of candles.number
rightRight offset, measured in amount of candles.number
bottomBottom offset, measured in percents of chart height.number

ChartConfigComponentsWaterMark

PropertyDescriptionType
visibleboolean
positionPosition on the screen.WaterMarkPositionType
offsetXnumber
offsetYnumber
logoWidthnumber
logoHeightnumber
fontFamilystring
firstRowFontSizeFont size for first text line.number
firstRowBottomPaddingPadding after first text line.number
secondRowFontSizeFont size for second text line.number
secondRowBottomPaddingPadding after second text line.number
thirdRowFontSizeFont size for third text line.number
thirdRowBottomPaddingPadding after third text line.number

ChartConfigComponentsEvents

PropertyDescriptionType
visibleToggle events visibility.boolean
eventsVisibilityToggle specific event type visibility (for example: dividends, splits, earnings).Record<EventType, boolean>
heightHeight of events area in pixelsnumber
cursorConfigure events cursor type.string
xAxisLabelFormatConfigure x axis labelsDateTimeFormatConfig[]
iconsConfigure icons, the format is string which contains svg tag, for example: '
	<path d="M1.06066 6.5L6.5 1.06066L11.9393 6.5L6.5 11.9393L1.06066 6.5Z" stroke="#D92C40" stroke-width="1.5"/>
</svg>'|[`ChartConfigComponentsEventsIcons`](#chartconfigcomponentseventsicons)|

ChartConfigComponentsEventsIcons

Configure icons, the format is string which contains svg tag, for example: ' '

PropertyDescriptionType
earningsCustomIcon
dividendsCustomIcon
splitsCustomIcon
conferenceCallsCustomIcon

CustomIcon

PropertyDescriptionType
normalstring
hoverstring

CustomIcon

PropertyDescriptionType
normalstring
hoverstring

CustomIcon

PropertyDescriptionType
normalstring
hoverstring

CustomIcon

PropertyDescriptionType
normalstring
hoverstring

ChartConfigComponentsHighLow

PropertyDescriptionType
visibleboolean
fontFont config of high/low labels.string

ChartConfigComponentsCrossTool

PropertyDescriptionType
typeThe type of cross tool. Visibility is also contolled by type, set 'none' to hide the cross tool.string
lineDashLine dash for cross tool.number[]
discreteWhen discrete is ON - the cross tool X coordinate will always be at the middle of candle.boolean
magnetTargetCross tool Y coordinate can magnet to OHLC values of candle.MagnetTarget
xAxisLabelFormatFormat of X label config for different periods.DateTimeFormatConfig[]
xLabelX label appearance.{ padding: { top: number; bottom: number; right: number; left: number; }; margin: { top: number; bottom?: number; }; }
yLabelX label appearance.{ padding: { top: number; bottom: number; end: number; start: number; }; type: YAxisLabelAppearanceType; }

ChartConfigComponentsHighlights

PropertyDescriptionType
visibleboolean
borderBorder of highlights (session breaks for example).{ width: number; dash: [number, number]; }
fontFamilystring
fontSizenumber

ChartConfigComponentsNavigationMap

PropertyDescriptionType
visibleboolean
allCandlesHistoryboolean
timeLabels{ visible: boolean; dateFormat: string; fontFamily: string; fontSize: number; padding: { x: number; y: number; }; }
cursors{ chart: string; buttonLeft: string; buttonRight: string; leftResizer: string; rightResizer: string; slider: string; }
knots{ height: number; width: number; border: number; lineWidth: number; }
minSliderWindowWidthnumber

ChartConfigComponentsBaseline

PropertyDescriptionType
cursorstring
dragZonenumber
heightnumber

ChartConfigComponentsPaneResizer

Horizontal resizer between panes

PropertyDescriptionType
visibleboolean
heightHeight of resizer in pixels.number
fixedModeMake the horizontal line fixed and disable resizing.boolean
dragZoneHover area of resizer in pixels.number
cursorstring

FullChartColors

All colors in chart-core are configured here.

PropertyDescriptionType
candleThemeCandleTheme
activeCandleThemeCandleTheme
barThemeLineStyleTheme
lineThemeLineStyleTheme
areaThemeAreaStyleTheme
chartAreaThemeChartAreaTheme
scatterPlotScatterPlotStyle
baseLineThemeBaselineStyleTheme
histogramHistogramColors
highlights`Record<"AFTER_MARKET"
volumeVolumeColors
secondaryChartThemeSecondaryChartTheme[]
waterMarkTheme{ firstRowColor: string; secondRowColor: string; thirdRowColor: string; }
highLowTheme{ highColor: string; lowColor: string; }
yAxis{ backgroundColor: string; backgroundHoverColor: string; zeroPercentLine: string; labelTextColor: string; labelInvertedTextColor: string; labelBoxColor: string; rectLabelTextColor: string; rectLabelInvertedTextColor: string; }
xAxis{ backgroundColor: string; labelTextColor: string; }
crossTool{ lineColor: string; labelBoxColor: string; labelTextColor: string; }
events{ earnings: EventColors; dividends: EventColors; splits: EventColors; 'conference-calls': EventColors; }
navigationMap{ buttonColor: string; knotColor: string; sliderColor: string; backgroundColor: string; buttonArrowColor: string; knotLineColor: string; knotBorderColor: string; timeLabelsTextColor: string; mapFillColor: string; mapGradientTopColor?: string; mapGradientBottomColor?: string; mapColor: string; }
instrumentInfo{ textColor: string; }
paneResizer{ lineColor: string; bgColor: string; bgHoverColor: string; }
labelsYAxisLabelsColors

CandleTheme

PropertyDescriptionType
upColorstring
downColorstring
noneColorstring
upWickColorstring
downWickColorstring
noneWickColorstring
borderOpacitynumber

CandleTheme

PropertyDescriptionType
upColorstring
downColorstring
noneColorstring
upWickColorstring
downWickColorstring
noneWickColorstring
borderOpacitynumber

LineStyleTheme

PropertyDescriptionType
upColorstring
downColorstring
noneColorstring

LineStyleTheme

PropertyDescriptionType
upColorstring
downColorstring
noneColorstring

AreaStyleTheme

PropertyDescriptionType
lineColorstring
startColorstring
stopColorstring

ChartAreaTheme

PropertyDescriptionType
backgroundMode`"regular"
backgroundColorstring
backgroundGradientTopColorstring
backgroundGradientBottomColorstring
gridColorstring

ScatterPlotStyle

PropertyDescriptionType
mainColorstring

BaselineStyleTheme

PropertyDescriptionType
upperSectionStrokeColorstring
lowerSectionStrokeColorstring
upperSectionFillColorstring
lowerSectionFillColorstring
baselineColorstring

HistogramColors

PropertyDescriptionType
upCapstring
upBottomstring
upBrightstring
downCapstring
downBottomstring
downBrightstring
noneCapstring
noneBottomstring
noneBrightstring

VolumeColors

PropertyDescriptionType
downCapColorstring
upCapColorstring
noneCapColorstring
downBarColorstring
upBarColorstring
noneBarColorstring

YAxisLabelsColors

PropertyDescriptionType
lastPriceYAxisLastPriceLabelColorConfig
bidAskYAxisBidAskLabelColorConfig
highLowYAxisHighLowLabelColorConfig
prePostMarketYAxisPrePostMarketLabelColorConfig
prevDayCloseYAxisLabelColorConfig

YAxisLastPriceLabelColorConfig

PropertyDescriptionType
boxSelectedstring
boxPositivestring
boxNegativestring
textSelectedstring
textNegativestring
textPositivestring

YAxisBidAskLabelColorConfig

PropertyDescriptionType
bidYAxisLabelColorConfig
askYAxisLabelColorConfig

YAxisLabelColorConfig

PropertyDescriptionType
boxColorstring
textColorstring
descriptionTextstring

YAxisLabelColorConfig

PropertyDescriptionType
boxColorstring
textColorstring
descriptionTextstring

YAxisHighLowLabelColorConfig

PropertyDescriptionType
highYAxisLabelColorConfig
lowYAxisLabelColorConfig

YAxisLabelColorConfig

PropertyDescriptionType
boxColorstring
textColorstring
descriptionTextstring

YAxisLabelColorConfig

PropertyDescriptionType
boxColorstring
textColorstring
descriptionTextstring

YAxisPrePostMarketLabelColorConfig

PropertyDescriptionType
preYAxisLabelColorConfig
postYAxisLabelColorConfig

YAxisLabelColorConfig

PropertyDescriptionType
boxColorstring
textColorstring
descriptionTextstring

YAxisLabelColorConfig

PropertyDescriptionType
boxColorstring
textColorstring
descriptionTextstring

YAxisLabelColorConfig

PropertyDescriptionType
boxColorstring
textColorstring
descriptionTextstring

DateFormatter

Date and time formatting configuration.

PropertyDescriptionType
applyPattern(pattern: string) => string
createFormatterFunction(pattern: string) => DateTimeFormatter
utcTimeOverride{ pattern?: string; test?: (pattern: string) => void; }

AnimationConfig

PropertyDescriptionType
durationnumber
timeLeftnumber