๐ ๏ธ From V8 to V9 โ
This document will help you upgrade from kinecharts 8.x to klinecharts 9.x. If you are 7.x or older, please refer to the previous upgrade document to upgrade to 8.x.
Import adjustment โ
klinecharts/index.blank'
and klinecharts/index.simple
are no longer distinguished. Please use import {...} from klinecharts
uniformly.
Design adjustment โ
shape
, annotation
, tag
are merged into overlay
. Please refer to overlay for details.
Style configuration adjustment โ
- The style options of all lines are changed to
dashed
anddashValue
todashedValue
. candle.tooltip.labels
andcandle.tooltip.values
are merged intocandle.tooltip.custom
.xAxis.height
is changed toxAxis.size
,xAxis.tickeText.paddingTop
is changed toxAxis.tickeText.marinStart
, andxAxis.tickeText.paddingBottom
is changed toxAxis.tickeText.marginEnd
.yAxis.height
is changed toyAxis.size
,yAxis.tickeText.paddingTop
is changed toyAxis.tickeText.marinStart
, andyAxis.tickeText.paddingBottom
is changed toyAxis.tickeText.marginEnd
.technicalIndicator.bar
is changed toindicator.bars
,technicalIndicator.line
is changed toindicator.lines
๏ผtechnicalIndicator.circle
is changed toindicator.circles
.- Delete
shape
,annotation
,tag
, please useoverlay
instead.
API adjustment โ
Chart API โ
extension.addTechnicalIndicatorTemplate(template)
is changed toregisterIndicator(template)
.- Delete
extension.addShapeTemplate(template)
, please useregisterOverlay(template)
instead.
Instance API โ
getDom({paneId, position})
is changed togetDom(paneId, position)
, and the parameterposition
option is changed toroot
,main
andyAxis
.getWidth()
andgetHeight()
are combined into a method 'getSize(paneId, position)
.setStyleOptions(styles)
is changed tosetStyles(styles)
.getStyleOptions()
is changed togetStyles()
.setOffsetRightSpace(space)
is changed tosetOffsetRightDistance(distance)
.createTechnicalIndicator(value, isStack, paneOptions)
is changed tocreateIndicator(value, isStack, paneOptions)
.overrideTechnicalIndicator(override, paneId)
is changed tooverrideIndicator(override, paneId)
.getTechnicalIndicatorByPaneId(paneId, name)
is changed togetIndicatorByPaneId(paneId, name)
.removeTechnicalIndicator(paneId, name)
is changed toremoveIndicator(paneId, name)
.subscribeAction(type, callback)
andunsubscribeAction(type, callback)
. The parametertype
option is changed toonZoom
,onScroll
,onCrosshairChange
,onVisibleRangeChange
andonPaneDrag
.convertToPixel(value, finder)
andconvertFromPixel(coordinate, finder)
, the parameterfinder.absoluteYAxis
is changed tofinder.absolute
.- To delete
createShape(value, paneId)
,createAnnotation(annotation, paneId)
,createTag(tag, paneId)
, please usecreateOverlay(value, paneId)
instead. - To delete
removeShape(id)
,removeAnnotation(paneId, points)
,removeTag(paneId, tagId)
, please useremoveOverlay(id)
instead. - To delete
setShapeOptions(options)
, useoverrideOverlay(override)
instead. - To delete
createHtml(html, paneId)
,removeHtml(paneId, htmlId)
, please obtain the corresponding dom throughgetDom(paneId, position)
. - To delete
getTechnicalIndicatorByPaneId(paneId, name)
.
Shape help API โ
- All APIs are migrated to 'klinecharts.utils'.
Customized technical indicator adjustment โ
- Attribute
plots
is changed tofigures
, sub item methodscolor
,isStroke
,isDashed
are merged intostyles
. - Change the method '
regeneratePlots(params)
toregenerateFigures(params)
. - The method
calcTechnicalIndicator(kLineDataList, options)
is changed tocalc(kLineDataList, indicator)
. - The method
createTooltipDataSource({ dataSource, viewport, crosshair, technicalIndicator, xAxis, yAxis, defaultStyles })
is changed tocreateTooltipDataSource({ kLineDataList, indicator, visibleRange, bounding, crosshair, defaultStyles, xAxis, yAxis })
. The return value is determined by[{ title: 'xxx', value: 'xxx', color: 'xxx' } ]
Change to{ name: 'xxx', calcParamsText: 'xxx', values: [{ title: 'xxx', value: 'xxx', color: 'xxx' }, ...] }
. - The method
render({ctx, dataSource, viewport, styles, xAxis, yAxis})
is changed todraw({ ctx, kLineDataList, indicator, visibleRange, bounding, barSpace, defaultStyles, xAxis, yAxis })
. - Delete the attribute
shouldCheckParamCount
.