🛠️ From 9.x to 10.x
This document will help you upgrade from klinecharts version 9.x to klinecharts version 10.x. If you are using version 8.x or older, please refer to v8 to v9 to upgrade to 9.x first.
Style configuration adjustment
- Remove
yAxis.position
,yAxis.type
,yAxis.inside
andyAxis.inside
. Please use the properties in the window configurationaxis
instead. For details, see the chart API init(dcs, options), instance API createIndicator(value, isStack, paneOptions) and setPaneOptions(options) . - Remove
overlay.rectText
,candle.tooltip.text
,indicator.tooltip.text
. - Remove
candle.tooltip.defaultValue
,candle.tooltip.custom
, please usecandle.tooltip.legend
instead. - Remove
indicator.tooltip.showName
,indicator.tooltip.showParams
, please useindicator.tooltip.title
instead. - Remove
indicator.tooltip.defaultValue
, please useindicator.tooltip.legend
instead. candle.tooltip.icons
changed tocandle.tooltip.features
,indicator.tooltip.icons
changed toindicator.tooltip.features
.
API adjustment
Chart API
- Remove
utils.drawArc(ctx, arc, styles)
,utils.drawCircle(ctx, circle, styles)
,utils.drawLine(ctx, line, styles)
,utils.drawPolygon(ctx, polygon, styles)
,utils.drawRect(ctx, rect, styles)
,utils.drawText(ctx, text, styles)
,utils.drawRectText(ctx, rectText, styles)
, please usegetFigureClass(name)
instead. init(dcs, options)
,position
inoptions.layout
sub-item changed toorder
,options.customApi
changed tooptions.formatter
, among whichformatDate(dateTimeFormat, timestamp, format, type)
changed toformatDate({ dateTimeFormat, timestamp, format, type })
,options.thousandsSeparator
changed to object{ sign, format }
,options.decimalFoldThreshold
changed tooptions.decimalFold
.
Instance API
- Remove
setCustomApi(api)
, please usesetFormatter(formatter)
instead. - Remove
getCustomApi(api)
, please usegetFormatter(formatter)
instead. - Remove
setPriceVolumePrecision(pricePrecision, volumePrecision)
, please usesetSymbol(symbolInfo)
instead. - Remove
applyNewData(dataList, data, callback)
,applyMoreData(dataList, more, callback)
,updateData(data, callback)
,setLoadDataCallback(cb)
andloadMore(cb)
, please usesetDataLoader(loader)
instead. - Remove
clearData()
- Remove
getIndicatorByPaneId(paneId, name)
, please usegetIndicators(filter)
instead. - Remove
getOverlayById(id)
, please usegetOverlays(filter)
instead. - Remove
onTooltipIconClick
insubscribeAction
andunsubscribeAction
, please useonCandleTooltipFeatureClick
andonIndicatorTooltipFeatureClick
in indicators instead. getBarSpace()
return value changed to object.createIndicator
return value changed to return indicator id.
Extension adjustment
- The indicator
createTooltipDataSource
method return valuevalues
changed tolegends
,icons
changed tofeatures
. - Remove the built-in basic graphic
rectText
, please usetext
instead.