🛠️ 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.insideandyAxis.inside. Please use the properties in the window configurationaxisinstead. 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.legendinstead. - Remove
indicator.tooltip.showName,indicator.tooltip.showParams, please useindicator.tooltip.titleinstead. - Remove
indicator.tooltip.defaultValue, please useindicator.tooltip.legendinstead. candle.tooltip.iconschanged tocandle.tooltip.features,indicator.tooltip.iconschanged 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),positioninoptions.layoutsub-item changed toorder,options.customApichanged tooptions.formatter, among whichformatDate(dateTimeFormat, timestamp, format, type)changed toformatDate({ dateTimeFormat, timestamp, format, type }),options.thousandsSeparatorchanged to object{ sign, format },options.decimalFoldThresholdchanged 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
onTooltipIconClickinsubscribeActionandunsubscribeAction, please useonCandleTooltipFeatureClickandonIndicatorTooltipFeatureClickin indicators instead. getBarSpace()return value changed to object.createIndicatorreturn value changed to return indicator id.
Extension adjustment
- The indicator
createTooltipDataSourcemethod return valuevalueschanged tolegends,iconschanged tofeatures. - The return value of the
calcmethod of the indicator has been changed from an array to an object whose key is a timestamp. - Remove the built-in basic graphic
rectText, please usetextinstead.