diff --git a/docs/.vitepress/config/en-US.js b/docs/.vitepress/config/en-US.js index a820c7fff..aafe372a1 100644 --- a/docs/.vitepress/config/en-US.js +++ b/docs/.vitepress/config/en-US.js @@ -23,8 +23,8 @@ export default defineConfig({ { text: 'Next', items: [ - { text: 'V9 Docs', link: 'https://v9.klinecharts.com/en-US' }, - { text: 'V8 Docs', link: 'https://v8.klinecharts.com' } + { text: '9.x Docs', link: 'https://v9.klinecharts.com/en-US' }, + { text: '8.x Docs', link: 'https://v8.klinecharts.com' } ] }, ], @@ -63,7 +63,7 @@ export default defineConfig({ text: 'Others', collapsed: false, items: [ - { text: 'V8 to V9', link: '/en-US/guide/v8-to-v9' }, + { text: '9.x to 10.x', link: '/en-US/guide/v9-to-v10' }, { text: 'FAQ', link: '/en-US/guide/faq' }, { text: 'Feedback', link: '/en-US/guide/feedback' }, { text: 'Changelog', link: '/en-US/guide/changelog' } diff --git a/docs/.vitepress/config/zh-CN.js b/docs/.vitepress/config/zh-CN.js index 7aafc8681..a56b5b04d 100644 --- a/docs/.vitepress/config/zh-CN.js +++ b/docs/.vitepress/config/zh-CN.js @@ -28,8 +28,8 @@ export default defineConfig({ { text: 'Next', items: [ - { text: 'V9 文档', link: 'https://v9.klinecharts.com' }, - { text: 'V8 文档', link: 'https://v8.klinecharts.com/zh-CN' } + { text: '9.x 文档', link: 'https://v9.klinecharts.com' }, + { text: '8.x 文档', link: 'https://v8.klinecharts.com/zh-CN' } ] }, ], @@ -68,7 +68,7 @@ export default defineConfig({ text: '其它', collapsed: false, items: [ - { text: '从v8到v9', link: '/guide/v8-to-v9' }, + { text: '从 9.x 到 10.x', link: '/guide/v9-to-v10' }, { text: '常见问题', link: '/guide/faq' }, { text: '反馈和共建', link: '/guide/feedback' }, { text: '更新日志', link: '/guide/changelog' } diff --git a/docs/@views/api/references/chart/registerYAxis.md b/docs/@views/api/references/chart/registerYAxis.md index 3f2e56607..054452de8 100644 --- a/docs/@views/api/references/chart/registerYAxis.md +++ b/docs/@views/api/references/chart/registerYAxis.md @@ -1,6 +1,6 @@ ```typescript ( - xAxis: { + yAxis: { name: string reverse?: boolean inside?: boolean diff --git a/docs/en-US/guide/changelog.md b/docs/en-US/guide/changelog.md index 388ee9b3c..1cfbf6258 100644 --- a/docs/en-US/guide/changelog.md +++ b/docs/en-US/guide/changelog.md @@ -1,249 +1,34 @@ # 📠 Change Log -## 9.8.10 -`2024-06-06` -+ 🐞 Fix the issue of blurry drawing of basic graphics `rect`, `line`. -+ 🐞 Fix the inaccurate zooming issue of instance methods `zoomAtCoordinate`, `zoomAtDataIndex` and `zoomAtTimestamp`. -+ 🐞 Fix the issue of possible error in x-axis zooming. -+ 💄 Optimize the instance method `subscribeAction`. When `type` is 'onScroll' and 'onZoom', the callback method adds a new parameter. -+ 💄 Optimize the sub-item `attrs` in the indicator attribute `figures`. Add callback parameter `data`. - -## 9.8.9 -`2024-05-28` -+ 🐞 Fix style configuration `yAxis.type: 'percentage'` error. -+ 🐞 Fix declaration issue in typescript. - -## 9.8.8 -`2024-05-14` -+ 🐞 Fix the issue that the style configuration `candle.tooltip.custom` cannot be overridden when it is an array. -+ 🐞 Fix the issue of decimal folding. -+ 💄 Optimize the parameter `precision` in the overlay callback method. - -## 9.8.7 -`2024-05-10` -+ 🐞 Fix the issue of unsynchronized price and volume precision in indicator precision. - -## 9.8.6 -`2024-05-07` -+ 🐞 Fix an issue that chart API `registerIndicator` and `registerOverlay` parameters `extendData` cannot take effect. -+ 🐞 Fix an issue of incorrect decimal folding when specifying `.` as the thousandth character. -+ 🐞 Fix an issue where overlays may not be moved after being created. - -## 9.8.5 -`2024-04-14` -+ 💄 Optimize the default right offset distance of the chart. -+ 🐞 Fix area chart display issue. -+ 🐞 Fix occasional blank spaces in chart. - -## 9.8.3 -`2024-04-12` -+ 💄 Optimize styles by adding `offsetLeft`, `offsetTop`, `offsetRight` and `offsetBottom` to `candle.tooltip` and `indicator.tooltip`. -+ 💄 Optimize figure and support array for attrs. -+ 💄 Optimize y-axis render. -+ 💄 Optimize default display, change the default candle width to 8. -+ 🐞 Fix `applyMoreData` add duplicate data issue. [@cryptotooltop](https://github.com/cryptotooltop) - -## 9.8.2 -`2024-03-26` -+ 💄 Optimize the display of the area chart. -+ 💄 Optimize smooth line drawing. -+ 🐞 Fix the overlay and drawing it to future time may not be an issue. - -## 9.8.1 -`2024-03-13` -+ 🐞 Fix an issue where initialize only `xAxis` in `layout` caused the chart to fail to initialize. -+ 🐞 Fix an issue when modify the built-in indicator `VOL` to `calcParams`. -+ 💄 Optimize the accuracy of width calculation when display decimal fold on the y-axis. -+ 💄 Optimize wheel event trigger. - -## 9.8.0 -`2024-03-04` -+ 🆕 Support custom coordinate axis. -+ 🆕 Support indicator mapping to future time. -+ 🆕 Support folding long decimals. -+ 🆕 Support adding data forward and backward. -+ 🐞 Fix formatting time issue for different browsers. - -`2024-01-12` -+ 🐞 Fix the issue of ineffective indicator attributes `minValue` and `maxValue`. -+ 🐞 Fix the display issue on the x-axis of the overlay. -+ 💄 Optimize the display of style `candle.type: 'ohlc'`. -+ 💄 Optimize drawing clarity. - -## 9.7.1 -`2023-12-18` -+ 🐞 Fix indicators and overlays methods not effect error. -+ 🐞 Fix package manager download node version dependency error. - -## 9.7.0 -`2023-12-12` -+ 🆕 Add instance apis`setMaxOffsetLeftDistance` and `setMaxOffsetRightDistance`. -+ 🆕 Add indicator attribute `zLevel`. -+ 💄 Optimize the rendering of the ohlc candle bar. -+ 🐞 Fix the blurry issue with the candle bar. -+ 🐞 Fix the rendering rules for the `zLevel` overlay. - -## 9.6.0 -`2023-11-14` -+ 🖋️ Refactor the separator module. -+ 🆕 Chart api `init(ds, options)`, parameter `options` add `layout`. -+ 🆕 Instance api `createIndicator(value, isStack, paneOptions, callback)`, parameter `PaneOptions` add `position`. -+ 🆕 Style `candle.tooltip.custom` adds `turnover` string template. -+ 💄 Optimize the style `overlay.text` configuration. -+ 💄 Optimize the implementation of `utils.clone` and `utils.merge`. -+ 🐞 Fix the issue of multiple overlay styles display error. -+ 🐞 Fix the issue of multiple indicator styles display error. - -## 9.5.4 -`2023-09-22` -+ 🐞 Fix the issue of not display the latest price line when the style `candle.type` is `area`. -+ 🐞 Fix the issue of incorrect display of the style `crosshair.vertical.text.paddingLeft`. - -## 9.5.3 -`2023-09-19` -+ 🐞 Fix typescript import error. - -## 9.5.2 -`2023-09-18` -+ 💄 Optimize the figure `text`. -+ 💄 Optimize built-in overlays `simpleAnnotation` and `simpleTag`. -+ 💄 Optimize the free style of technical indicators and support increment. -+ 🐞 Fix typescript declaration issue. - -## 9.5.1 -`2023-08-14` -+ 🆕 Add chart api `getOverlayClass`. -+ 🆕 Style configuration `candle.tooltip.custom` add built-in support `change`. -+ 💄 Optimize figure `rect` event trigger. -+ ↩️ Separator event trigger optimization rollback. - -## 9.5.0 -`2023-06-15` -+ 🆕 `Overlay` add event `onDoubleClick`, add property `modeSensitivity`. -+ 🆕 Style configuration `candle.tooltip.custom` supports string templates. -+ 🐞 Optimize the scrolling frame drop issue on the mobile side. -+ 🐞 Fix pane id naming typo. -+ 💄 Optimize the response sensitivity of dividing line events. -+ 💄 Optimize the attrs type declaration in OverlayFigure under typescript. - -## 9.4.0 -`2023-05-25` -+ 🆕 Instance API 'createOverlay' supports arrays. -+ 🆕 `overlay` add attributes `paneId`, `defaultZLevel` and `zLevel`. -+ 🆕 `xAxis` add methods `convertTimestampFromPixel` and `convertTimestampToPixel`. -+ 💄 Optimize the display of candle. - -## 9.3.0 -`2023-05-13` -+ 🆕 Add chart API `utils.calcTextWidth`. -+ 🆕 The instance APIs `createIndicator(value, isStack, options)` and `setPaneOptions(options)` have added `options. axisOptions`. -+ 🆕 The indicator graphic configuration supports customization. -+ 💄 Optimize the bar width ratio. -+ 💄 Optimize internal acquisition of screen pixel ratio. -+ 💄 Optimize internal ID generation. - - -## 9.2.2 -`2023-05-04` -+ 🐞 Fix figure `line` check event error. -+ 💄 Optimize type check. - -## 9.2.1 -`2023-04-27` -+ 💄 Optimize the default style by changing `#EF5350` to `#F92855` and `#26A69A` to `#2DC08E`. -+ 💄 Optimize typescript declarations. - -## 9.2.0 -`2023-04-24` -+ 🆕 Add instance API `getOffsetRightDistance` and `executeAction`. -+ 🆕 Add success callback for instance API `applyNewData`, `applyMoreData` and `updateData`. -+ 🆕 Support the display of thousands. -+ 🆕 Add style configuration `candle.bar.upBorderColor`, `candle.bar.downBorderColor`, `candle.bar.noChangeBorderColor`, `candle.bar.upWickColor`, `candle.bar.downWickColor`, `candle.bar.noChangeWickColor`, `candle.tooltip.rect.position` and `candle.tooltip.rect.offsetBottom`. -+ 🆕 Add `realFrom` and `realTo` to all `visibleRange`. -+ 💄 Optimize API, `klinecharts.utils.isValid` and `klinecharts.utils.formatBigNumber`. -+ 💄 Optimize the log output in the development environment. - -## 9.1.3 -`2023-04-15` -+ 🐞 Fix the issue of not refreshing when the input parameter of the chart API `applyNewData` is an empty array. -+ 🐞 Fix the issue of cross cursor text not displaying on the y-axis when there is no data. -+ 💄 Optimize the display of area chart. -+ 💄 Optimize coverage event callback parameters and add `figureKey` and `figureIndex`. -+ 💄 Optimize typescript overlay style types, as well as base types `DeepPartial` and `DeepRequired`. - -## 9.1.2 -`2023-04-10` -+ 🐞 Fix the issue of inaccurate triggering events for the built-in figure `line`. -+ 🐞 Fix the issue of triggering events for the first time after the `simpleAnnotation` and `simpleTag` built-in overlays are drawn. -+ 💄 Optimize overlay figure to ignore events and support event selection. - -## 9.1.1 -`2023-03-14` -+ 🐞 Fix the invalidity of the built-in figure `arc`. -+ 💄 Optimize rendering updates. - -## 9.1.0 -`2023-02-23` -+ 🆕 The chart instance method `subscribeAction` and `unsubscribeAction` types add `onCandleBarClick`. -+ 🆕 The overlay supports double-clicking to force the end of drawing. -+ 💄 Optimize event handling. - - -## 9.0.1 -`2023-02-17` -🐞 Fix the introduction of typescript. - -## 9.0.0 -`2023-02-16` -+ 🛠 Typescript refactoring. +## 10.0.0-alpha1 +`2024-12-01` + 🆕 New features - + Add Y axis direction zoom and scroll. - + API - + New chart methods `registerFigure`, `getSupportFigures`, `getFigureClass`, `rigiderOverlay`, `getSupportOverlays`, `registerLocale`, `getSupportLocales`, `registerStyles` are added. - + New instance methods, `getSize`, `setLocale`, `getLocal`, `setCustomApi`, `getVisibleRange`, `createOverlay`, `getOverlayById`, `overrideOverlay`, `removeOverlay`. - + Style Configuration - + Add `candle.priceMark.last.text.borderStyle`, `candle.tooltip.icons`, `indicator.lastValueMark.text.borderStyle`, `indicator.tooltip.icons`, `crosshair.horizontal. text.borderStyle`, `crosshair.vertical.text.borderStyle`. -+ 👉 Change - + API - + Chart method `extension.addTechnicalIndicatorTemplate` is changed to `registerIndicator`. - + Chart method `extension.addShapeTemplate` is changed to `registerOverlay`. - + Instance method `setStyleOptions` is changed to `setStyles`. - + Instance method `getStyleOptions` is changed to `getStyles`. - + Instance method `setPaneOptions(options)`, `options` add new attribute `gap`. - + Instance method `setOffsetRightSpace` is changed to `setOffsetRightDistance`. - + Instance method `createTechnicalIndicator` is changed to `createIndicator` - + Instance method `overlayTechnicalIndicator` is changed to `overrideIndicator`. - + Instance method `getTechnicalIndicatorByPaneId` is changed to `getIndicatorByPaneId`. - + Instance method `removeTechnicalIndicator` is changed to `removeIndicator`. - + Style Configuration - + All `line.style` options are changed to `solid` and `dashed`. - + All `dashValue` is changed to `dashedValue`. - + `xAxis.height` is changed to `xAxis.size`, `xAxis.tickeText.paddingTop` is changed to `xAxis.tickeText.marinStart`, and `xAxis.tickeText.paddingBottom` is changed to `xAxis.tickeText.marinEnd`. - + `yAxis.height` is changed to `yAxis.size`, `yAxis.tickeText.paddingTop` is changed to `yAxis.tickeText.marinStart`, and `yAxis.tickeText.paddingBottom` is changed to `yAxis.tickeText.marinEnd`. - + `technicalIndicator.bar` is changed to `indicator.bars`, `technicalIndicator.line` is changed to `indicator.lines`,`technicalIndicator.circle` is changed to `indicator.circles` - + Custom Extension - + The technical indicator attribute `calcParams` has been changed to support any type. - + The technical indicator attribute `plots` is changed to `figures`. - + The technical indicator attribute `regeneratePlots` is changed to' regeneratefigures'. - + The technical indicator attribute `calcTechnicalIndicator` is changed to `calc`. - + The technical indicator attribute `render` is changed to 'draw'. -+ 🗑 Abandonment - + API - + Delete instance methods `getWidth`, `getHeight`, and use `getSize` instead. - + Delete instance methods `createShape`, `createAnnotation`, `createTag`, and use `createOverlay` instead. - + Delete instance methods `removeShape`, `removeAnnotation`, `removeTag`. Use `removeOverlay` instead. - + Delete the instance method `setShapeOptions` and use `overrideOverlay` instead. - + Delete instance methods `createHtml`, `removeHtml`, `addTechnicalIndicatorTemplate`, `getTechnicalIndicatorTemplate`, `addShapeTemplate`. - + Style Configuration - + Delete `shape`, `annotation`, `tag` and use `overlay` instead. - + Delete `candle.margin`,`technicalIndicator.margin`。 - + Custom Extension - + The related attributes are no longer saved in the technical indicator template. - + Delete `Shape` and use `Overlay` instead. + + Support thousand separators and custom decimal folding. + + Rewrite the axis module, and customize the y-axis to support setting ranges. + + Add instance methods `setPrecision(precision)` , `getPrecision()` , `setThousandsSeparator(thousandsSeparator)` , `getThousandsSeparator()` , `setDecimalFold(decimalFold)` , `getDecimalFold()` and `setLoadMoreDataCallback(cb)` . ++ 👉 Changes + + Chart api `init(dcs, options)`, `position` in `options.layout` child changed to `order` , `formatDate(dateTimeFormat, timestamp, format, type)` in `options.customApi` changed to `formatDate(timestamp, format, type)` , `options.thousandsSeparator` changed to object `{ sign, format }` , `options.decimalFoldThreshold` changed to `options.decimalFold` . + + Instance api `applyNewData(dataList, more, callback)` changed to `applyNewData(dataList, more)` . + + Instance api `updateData(data, callback)` changed to `updateData(data)` . + + Instance api `getBarSpace()` return value changed to object. + + The return value of the custom indicator `createTooltipDataSource` method `values` is changed to `legends` . ++ 🗑 Deprecated + + Remove chart api `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 use `getFigureClass(name)` instead. + + Remove instance api `setPriceVolumePrecision(pricePrecision, volumePrecision)`, please use `setPrecision(precision)` instead. + + Remove instance api `applyMoreData(dataList, more, callback)`, `setLoadDataCallback(cb)` and `loadMore(cb)`, please use `setLoadMoreDataCallback(cb)` instead. + + Remove instance api `getIndicatorByPaneId(paneId, name)`, please use `getIndicators(filter)` instead. + + Remove instance api `getOverlayById(id)`, please use `getOverlays(filter)` instead. + + Remove style configuration `yAxis.position` , `yAxis.type` , `yAxis.inside` and `yAxis.inside` , please use the properties in the window configuration `axis` instead. For details, refer to the chart API [init(dcs, options)](/api/chart/init#parameters), the instance API [createIndicator(value, isStack, paneOptions)](/api/instance/createIndicator#parameters) and [setPaneOptions(options)](/api/instance/setPaneOptions#parameters). + + Remove `overlay.rectText` from style configuration. + + Remove `rectText` from built-in basic graphics, please use `text` instead. + +## 9.x + +Go to [https://v9.klinecharts.com](https://v9.klinecharts.com) to check the change log for 9.x. ## 8.x -Go to [Github](https://github.com/liihuu/KLineChart/blob/v8.6.3/docs/en/changelog.md) to check the change log for 8.x. +Go to [https://v8.klinecharts.com](https://v8.klinecharts.com) to check the change log for 9.x. ## 7.x diff --git a/docs/en-US/guide/v8-to-v9.md b/docs/en-US/guide/v8-to-v9.md deleted file mode 100644 index 269f010af..000000000 --- a/docs/en-US/guide/v8-to-v9.md +++ /dev/null @@ -1,50 +0,0 @@ -# 🛠️ 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](./overlay.md) for details. - -## Style configuration adjustment -+ The style options of all lines are changed to `dashed` and `dashValue` to `dashedValue`. -+ `candle.tooltip.labels` and `candle.tooltip.values` are merged into `candle.tooltip.custom`. -+ `xAxis.height` is changed to `xAxis.size`, `xAxis.tickeText.paddingTop` is changed to `xAxis.tickeText.marinStart`, and `xAxis.tickeText.paddingBottom` is changed to `xAxis.tickeText.marginEnd`. -+ `yAxis.height` is changed to `yAxis.size`, `yAxis.tickeText.paddingTop` is changed to `yAxis.tickeText.marinStart`, and `yAxis.tickeText.paddingBottom` is changed to `yAxis.tickeText.marginEnd`. -+ `technicalIndicator.bar` is changed to `indicator.bars`, `technicalIndicator.line` is changed to `indicator.lines`,`technicalIndicator.circle` is changed to `indicator.circles`. -+ Delete `shape`, `annotation`, `tag`, please use `overlay` instead. - -## API adjustment -### Chart API -+ `extension.addTechnicalIndicatorTemplate(template)` is changed to `registerIndicator(template)`. -+ Delete `extension.addShapeTemplate(template)`, please use `registerOverlay(template)` instead. - -### Instance API -+ `getDom({paneId, position})` is changed to `getDom(paneId, position)`, and the parameter `position` option is changed to `root`, `main` and `yAxis`. -+ `getWidth()` and `getHeight()` are combined into a method '`getSize(paneId, position)`. -+ `setStyleOptions(styles)` is changed to `setStyles(styles)`. -+ `getStyleOptions()` is changed to `getStyles()`. -+ `setOffsetRightSpace(space)` is changed to `setOffsetRightDistance(distance)`. -+ `createTechnicalIndicator(value, isStack, paneOptions)` is changed to `createIndicator(value, isStack, paneOptions)`. -+ `overrideTechnicalIndicator(override, paneId)` is changed to `overrideIndicator(override, paneId)`. -+ `getTechnicalIndicatorByPaneId(paneId, name)` is changed to `getIndicatorByPaneId(paneId, name)`. -+ `removeTechnicalIndicator(paneId, name)` is changed to `removeIndicator(paneId, name)`. -+ `subscribeAction(type, callback)` and `unsubscribeAction(type, callback)`. The parameter `type` option is changed to ` onZoom`, `onScroll`, `onCrosshairChange`, `onVisibleRangeChange` and `onPaneDrag`. -+ `convertToPixel(value, finder)` and `convertFromPixel(coordinate, finder)`, the parameter `finder.absoluteYAxis` is changed to `finder.absolute`. -+ To delete `createShape(value, paneId)`, `createAnnotation(annotation, paneId)`, `createTag(tag, paneId)`, please use `createOverlay(value, paneId)` instead. -+ To delete `removeShape(id)`, `removeAnnotation(paneId, points)`, `removeTag(paneId, tagId)`, please use `removeOverlay(id)` instead. -+ To delete `setShapeOptions(options)`, use `overrideOverlay(override)` instead. -+ To delete `createHtml(html, paneId)`, `removeHtml(paneId, htmlId)`, please obtain the corresponding dom through `getDom(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 to `figures`, sub item methods `color`, `isStroke`, `isDashed` are merged into `styles`. -+ Change the method '`regeneratePlots(params)` to `regenerateFigures(params)`. -+ The method `calcTechnicalIndicator(kLineDataList, options)` is changed to `calc(kLineDataList, indicator)`. -+ The method `createTooltipDataSource({ dataSource, viewport, crosshair, technicalIndicator, xAxis, yAxis, defaultStyles })` is changed to `createTooltipDataSource({ 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 to `draw({ ctx, kLineDataList, indicator, visibleRange, bounding, barSpace, defaultStyles, xAxis, yAxis })`. -+ Delete the attribute `shouldCheckParamCount`. \ No newline at end of file diff --git a/docs/en-US/guide/v9-to-v10.md b/docs/en-US/guide/v9-to-v10.md new file mode 100644 index 000000000..5d232cbcd --- /dev/null +++ b/docs/en-US/guide/v9-to-v10.md @@ -0,0 +1,25 @@ +# 🛠️ 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](https://v9.klinecharts.com/en-US/guide/v8-to-v9) to upgrade to 9.x first. + +## Style configuration adjustment ++ Remove `yAxis.position` , `yAxis.type` , `yAxis.inside` and `yAxis.inside` . Please use the properties in the window configuration `axis` instead. For details, see the chart API [init(dcs, options)](/en-US/api/chart/init#parameters), instance API [createIndicator(value, isStack, paneOptions)](/en-US/api/instance/createIndicator#parameters) and [setPaneOptions(options)](/en-US/api/instance/setPaneOptions#parameters) . ++ Remove `overlay.rectText` . + +## 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 use `getFigureClass(name)` instead. ++ `init(dcs, options)` , `position` in `options.layout` sub-item changed to `order` , `formatDate(dateTimeFormat, timestamp, format, type)` in `options.customApi` changed to `formatDate(timestamp, format, type)` , `options.thousandsSeparator` changed to object `{ sign, format }` , `options.decimalFoldThreshold` changed to `options.decimalFold` . + +### Instance API ++ Remove `setPriceVolumePrecision(pricePrecision, volumePrecision)`, please use `setPrecision(precision)` instead. ++ Remove `applyMoreData(dataList, more, callback)` , `setLoadDataCallback(cb)` and `loadMore(cb)` , please use `setLoadMoreDataCallback(cb)` instead. ++ Remove `getIndicatorByPaneId(paneId, name)`, please use `getIndicators(filter)` instead. ++ Remove `getOverlayById(id)`, please use `getOverlays(filter)` instead. ++ `applyNewData(dataList, more, callback)` is changed to `applyNewData(dataList, more)` . ++ `updateData(data, callback)` is changed to `updateData(data)` . ++ `getBarSpace()` return value changed to object. + +## Extension adjustment ++ The indicator `createTooltipDataSource` method return value `values` changed to `legends` . ++ Remove the built-in basic graphic `rectText`, please use `text` instead. diff --git a/docs/guide/changelog.md b/docs/guide/changelog.md index d53c0cc20..0994c2a17 100644 --- a/docs/guide/changelog.md +++ b/docs/guide/changelog.md @@ -1,269 +1,49 @@ # 📠 更新日志 -## 9.8.10 -`2024-06-06` -+ 🐞 修复基础图形 `rect`, `line` 绘制模糊问题。 -+ 🐞 修复实例方法 `zoomAtCoordinate`、`zoomAtDataIndex` 和 `zoomAtTimestamp`,缩放不准确问题。 -+ 🐞 修复x轴缩放可能出错问题。 -+ 💄 优化实例方法 `subscribeAction`,当 `type` 是 'onScroll' 和 'onZoom' 时,回调方法新增参数。 -+ 💄 优化指标属性 `figures` 中的子项 `attrs`,新增回调参数 `data`。 - -## 9.8.9 -`2024-05-28` -+ 🐞 修复样式配置 `yAxis.type: 'percentage'` 错误。 -+ 🐞 修复 typescript 中声明问题。 - -## 9.8.8 -`2024-05-14` -+ 🐞 修复样式配置 `candle.tooltip.custom` 是数组时无法覆盖问题。 -+ 🐞 修复小数折叠不准确问题。 -+ 💄 优化覆盖物回调方法中的参数 `precision` 。 - -## 9.8.7 -`2024-05-10` -+ 🐞 修复指标精度不同步价格数量精度问题。 - -## 9.8.6 -`2024-05-07` -+ 🐞 修复图表API `registerIndicator` 和 `registerOverlay` 参数 `extendData` 无法生效问题。 -+ 🐞 修复千分符指定 `.` 时,导致小数折叠不对问题。 -+ 🐞 修复创建覆盖物后,可以无法拖动问题。 - -## 9.8.5 -`2024-04-14` -+ 💄 优化图表默认右偏移距离。 -+ 🐞 修复面积图显示问题。 -+ 🐞 修复图表偶发会空白问题。 - -## 9.8.3 -`2024-04-12` -+ 💄 优化样式,`candle.tooltip` 和 `indicator.tooltip` 新增 `offsetLeft`,`offsetTop`,`offsetRight`,`offsetBottom`。 -+ 💄 优化基础图形,图形属性支持数组。 -+ 💄 优化y轴渲染。 -+ 💄 优化默认显示,蜡烛柱默认宽度改为8。 -+ 🐞 修复 `applyMoreData` 添加重复数据问题。[@cryptotooltop](https://github.com/cryptotooltop) - -## 9.8.2 -`2024-03-26` -+ 💄 优化面积图显示。 -+ 💄 优化平滑曲线绘制。 -+ 🐞 修复覆盖物绘制到未来时间,可能不对问题。 - -## 9.8.1 -`2024-03-13` -+ 🐞 修复初始化`layout`只指定`xAxis`时,导致图表无法初始化问题。 -+ 🐞 修复内置指标`VOL`修改`calcParams`时出错问题。 -+ 💄 优化y轴小数折叠显示时计算的宽度准确度。 -+ 💄 优化滚轮事件触发。 - -## 9.8.0 -`2024-03-04` -+ 🆕 支持自定义坐标轴。 -+ 🆕 支持指标绘制到未来时间。 -+ 🆕 支持长小数折叠。 -+ 🆕 支持向前和向后添加数据。 -+ 🐞 修复不同浏览器格式化时间问题。 - -## 9.7.2 -`2024-01-12` -+ 🐞 修复指标属性 `minValue` 和 `maxValue` 不生效问题。 -+ 🐞 修复覆盖物x轴上显示问题。 -+ 💄 优化样式 `candle.type: 'ohlc'` 显示。 -+ 💄 优化绘制清晰度。 - -## 9.7.1 -`2023-12-18` -+ 🐞 修复指标和覆盖物方法不执行问题。 -+ 🐞 修复包管理器下载node版本依赖问题。 - -## 9.7.0 -`2023-12-12` -+ 🆕 实例方法新增`setMaxOffsetLeftDistance`和`setMaxOffsetRightDistance`。 -+ 🆕 指标新增`zLevel`属性。 -+ 💄 优化`ohlc`蜡烛柱渲染。 -+ 🐞 修复蜡烛柱模糊问题。 -+ 🐞 修复覆盖物`zLevel`渲染规则。 - -## 9.6.0 -`2023-11-14` -+ 🖋️ 重构窗口之间的分割线模块。 -+ 🆕 图表方法`init(ds, options)`,参数`options`新增`layout`。 -+ 🆕 实例方法`createIndicator(value, isStack, paneOptions, callback)`,参数`paneOptions`新增`position`。 -+ 🆕 样式`candle.tooltip.custom`新增`turnover`字符串模版。 -+ 💄 优化样式`overlay.text`配置。 -+ 💄 优化`utils.clone`和`utils.merge`实现。 -+ 🐞 修复多个覆盖物样式显示不对问题。 -+ 🐞 修复多个指标样式显示不对问题。 - - -## 9.5.4 -`2023-09-22` -+ 🐞 修复样式`candle.type`是`area`时,最新价线不显示问题。 -+ 🐞 修复样式`crosshair.vertical.text.paddingLeft`显示不对问题。 - -## 9.5.3 -`2023-09-19` -+ 🐞 修复ts下引入问题。 - -## 9.5.2 -`2023-09-18` -+ 💄 优化基础图形`text`。 -+ 💄 优化内置覆盖物`simpleAnnotation`和`simpleTag`。 -+ 💄 优化技术指标自由样式,支持增量。 -+ 🐞 修复typescript声明问题。 - -## 9.5.1 -`2023-08-14` -+ 🆕 图表方法新增`getOverlayClass`。 -+ 🆕 样式配置`candle.tooltip.custom`新增内置涨跌幅支持。 -+ 💄 优化基础图形`rect`事件响应。 -+ ↩️ 分割线事件响应回退 - - -## 9.5.0 -`2023-06-15` -+ 🆕 `Overlay`新增事件`onDoubleClick`,新增属性`modeSensitivity`。 -+ 🆕 样式配置`candle.tooltip.custom`支持字符串模版。 -+ 🐞 优化移动端阻尼滚动掉帧问题。 -+ 🐞 修复窗口id命名拼写错误。 -+ 💄 优化分割线事件响应灵敏度。 -+ 💄 优化typescript下,OverlayFigure中的attrs类型声明。 - - -## 9.4.0 -`2023-05-25` -+ 🆕 实例api `createOverlay` 支持数组。 -+ 🆕 `overlay`新增属性`paneId`,`defaultZLevel`和`zLevel`。 -+ 🆕 `xAxis`新增方法`convertTimestampFromPixel`和`convertTimestampToPixel`。 -+ 💄 优化蜡烛柱显示。 - -## 9.3.0 -`2023-05-13` -+ 🆕 新增图表API `utils.calcTextWidth`。 -+ 🆕 图表API `createIndicator(value, isStack, options)`和`setPaneOptions(options)`新增`options.axisOptions`。 -+ 🆕 指标图形配置支持自定义。 -+ 💄 优化bar宽度比例。 -+ 💄 优化内部获取屏幕像素比。 -+ 💄 优化内部id生成。 - - -## 9.2.2 -`2023-05-04` -+ 🐞 修复基础图形`line`事件检查可能导致错误问题。 -+ 💄 优化类型检查。 - - -## 9.2.1 -`2023-04-27` -+ 💄 优化默认样式,`#EF5350`变更为`#F92855`,`#26A69A`变更为`#2DC08E`。 -+ 💄 优化typescript声明。 - -## 9.2.0 -`2023-04-24` -+ 🆕 实例API新增`getOffsetRightDistance`和`executeAction`。 -+ 🆕 实例API`applyNewData`、`applyMoreData`和`updateData`新增成功回调入参`callback`。 -+ 🆕 支持千分符显示。 -+ 🆕 样式配置新增`candle.bar.upBorderColor`、`candle.bar.downBorderColor`、`candle.bar.noChangeBorderColor`、`candle.bar.upWickColor`、`candle.bar.downWickColor`、`candle.bar.noChangeWickColor`、`candle.tooltip.rect.position`和`candle.tooltip.rect.offsetBottom`。 -+ 🆕 所有`visibleRange`新增`realFrom`和`realTo`。 -+ 💄 优化API,`klinecharts.utils.isValid`和`klinecharts.utils.formatBigNumber`。 -+ 💄 优化开发环境下,日志输出。 - -## 9.1.3 -`2023-04-15` -+ 🐞 修复图表api `applyNewData` 入参是空数组时不刷新问题。 -+ 🐞 修复无数据时y轴上十字光标文字不显示问题。 -+ 💄 优化面积图显示。 -+ 💄 优化覆盖物事件回调参数,新增`figureKey`和`figureIndex`。 -+ 💄 优化typescript覆盖物样式类型,和基础类型`DeepPartial`, `DeepRequired`。 - -## 9.1.2 -`2023-04-10` -+ 🐞 修复内置基础图形`line`触发事件不准确问题。 -+ 🐞 修复内置覆盖物`simpleAnnotation`和`simpleTag`绘制完成后第一次触发事件问题。 -+ 💄 优化覆盖物图形事件忽略,支持事件选择。 - -## 9.1.1 -`2023-03-14` -+ 🐞 修复内置基础图形`arc`不生效问题。 -+ 💄 优化渲染更新。 - -## 9.1.0 -`2023-02-23` -+ 🆕 图表实例方法`subscribeAction`和`unsubscribeAction`类型新增`onCandleBarClick`。 -+ 🆕 覆盖物支持双击强制结束绘制。 -+ 💄 优化事件处理。 - -## 9.0.1 -`2023-02-17` -+ 🐞 修复typescript引入问题。 - -## 9.0.0 -`2023-02-16` -+ 🛠 Typescript重构。 +## 10.0.0-alpha1 +`2024-12-01` + 🆕 新特性 - + 新增Y轴方向缩放,滚动。 - + API - + 新增基图表方法`registerFigure`,`getSupportFigures`,`getFigureClass`,`rigisterOverlay`,`getSupportOverlays`,`registerLocale`,`getSupportLocales`,`registerStyles`。 - + 新增实例方法,`getSize`,`setLocale`,`getLocal`,`setCustomApi`,`getVisibleRange`,`createOverlay`,`getOverlayById`,`overrideOverlay`,`removeOverlay`。 - + 样式配置 - + 新增`candle.priceMark.last.text.borderStyle`,`candle.tooltip.icons`,`indicator.lastValueMark.text.borderStyle`,`indicator.tooltip.icons`,`crosshair.horizontal.text.borderStyle`,`crosshair.vertical.text.borderStyle`。 + + 支持千分符,小数折叠自定义。 + + 重写坐标轴模块,自定义y轴支持设置范围。 + + 新增实例方法 `setPrecision(precision)` , `getPrecision()` , `setThousandsSeparator(thousandsSeparator)` , `getThousandsSeparator()` , `setDecimalFold(decimalFold)` , `getDecimalFold()` 和 `setLoadMoreDataCallback(cb)` 。 + 👉 变更 - + API - + 图表方法`extension.addTechnicalIndicatorTemplate`变更为`registerIndicator`。 - + 图表方法`extension.addShapeTemplate`变更为`registerOverlay`。 - + 实例方法`setStyleOptions`变更为`setStyles`。 - + 实例方法`getStyleOptions`变更为`getStyles`。 - + 实例方法`setPaneOptions(options)`,`options`新增属性`gap`。 - + 实例方法`setOffsetRightSpace`变更为`setOffsetRightDistance`。 - + 实例方法`createTechnicalIndicator`变更为`createIndicator`。 - + 实例方法`overlayTechnicalIndicator`变更为`overlayIndicator`。 - + 实例方法`getTechnicalIndicatorByPaneId`变更为`getIndicatorByPaneId`。 - + 实例方法`removeTechnicalIndicator`变更为`removeIndicator`。 - + 样式配置 - + 所有`line.style`选项变更为`solid`和`dashed`。 - + 所有`dashValue`变更为`dashedValue`。 - + `xAxis.height`变更为`xAxis.size`,`xAxis.tickText.paddingTop`变更为`xAxis.tickText.marginStart`,`xAxis.tickText.paddingBottom`变更为`xAxis.tickText.marginEnd`。 - + `yAxis.height`变更为`yAxis.size`,`yAxis.tickText.paddingTop`变更为`yAxis.tickText.marginStart`,`yAxis.tickText.paddingBottom`变更为`yAxis.tickText.marginEnd`。 - + `technicalIndicator.bar`变更为`indicator.bars`,`technicalIndicator.line`变更为`indicator.lines`,`technicalIndicator.circle`变更为`indicator.circles`。 - + 自定义扩展 - + 技术指标属性`calcParams`,变更为支持任意类型。 - + 技术指标属性`plots`变更为`figures`。 - + 技术指标属性`regeneratePlots`变更为`regeneratefigures`。 - + 技术指标属性`calcTechnicalIndicator`变更为`calc`。 - + 技术指标属性`render`变更为`draw`。 + + 图表方法 `init(dcs, options)` , `options.layout` 子项中的 `position` 变更为 `order` , `options.customApi` 中的 `formatDate(dateTimeFormat, timestamp, format, type)` 变更为 `formatDate(timestamp, format, type)` , `options.thousandsSeparator` 变更为对象 `{ sign, format }` , `options.decimalFoldThreshold` 变更为 `options.decimalFold` 。 + + 实例方法 `applyNewData(dataList, more, callback)` 变更为 `applyNewData(dataList, more)` 。 + + 实例方法 `updateData(data, callback)` 变更为 `updateData(data)` 。 + + 实例方法 `getBarSpace()` 返回值变更为对象。 + + 自定义指标 `createTooltipDataSource` 方法返回值 `values` 变更为 `legends` 。 + 🗑 废弃 - + API - + 删除实例方法`getWidth`,`getHeight`,改用`getSize`。 - + 删除实例方法`createShape`,`createAnnotation`,`createTag`,改用`createOverlay`。 - + 删除实例方法`removeShape`,`removeAnnotation`,`removeTag`,改用`removeOverlay`。 - + 删除实例方法`setShapeOptions`,改用`overrideOverlay`。 - + 删除实例方法`createHtml`,`removeHtml`,`addTechnicalIndicatorTemplate`,`getTechnicalIndicatorTemplate`,`addShapeTemplate`。 - + 样式配置 - + 删除`shape`,`annotation`,`tag`,改用`overlay`。 - + 删除`candle.margin`,`technicalIndicator.margin`。 - + 自定义扩展 - + 技术指标模版不再保存相关属性。 - + 技术指标删除属性`shouldCheckParamCount`。 - + 删除`Shape`,改用`Overlay`。 + + 图表方法删除 `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)`,请使用 `getFigureClass(name)` 代替。 + + 实例方法删除 `setPriceVolumePrecision(pricePrecision, volumePrecision)` ,请使用 `setPrecision(precision)` 代替。 + + 实例方法删除 `applyMoreData(dataList, more, callback)` , `setLoadDataCallback(cb)` 和 `loadMore(cb)` ,请使用 `setLoadMoreDataCallback(cb)` 代替。 + + 实例方法删除 `getIndicatorByPaneId(paneId, name)` ,请使用 `getIndicators(filter)` 代替。 + + 实例方法删除 `getOverlayById(id)` ,请使用 `getOverlays(filter)` 代替。 + + 样式配置删除 `yAxis.position` , `yAxis.type` , `yAxis.inside` 和 `yAxis.inside` ,请使用窗口配置 `axis` 中的属性代替。详情参阅图表API [init(dcs, options)](/api/chart/init#parameters) ,实例API [createIndicator(value, isStack, paneOptions)](/api/instance/createIndicator#parameters) 和 [setPaneOptions(options)](/api/instance/setPaneOptions#parameters) 。 + + 样式配置删除 `overlay.rectText` 。 + + 内置的基础图形删除 `rectText` ,请使用 `text` 代替。 + +## 9.x + +去 [https://v9.klinecharts.com](https://v9.klinecharts.com) 上查看。 ## 8.x -去[Github](https://github.com/liihuu/KLineChart/blob/v8.6.3/docs/zh-CN/changelog.md)上查看 8.x 的 Change Log。 +去 [https://v8.klinecharts.com](https://v8.klinecharts.com) 上查看。 ## 7.x -去[Github](https://github.com/liihuu/KLineChart/blob/v7.5.0/docs/zh-CN/changelog.md)上查看 7.x 的 Change Log。 +去 [Github](https://github.com/liihuu/KLineChart/blob/v7.5.0/docs/zh-CN/changelog.md) 上查看 7.x 的 Change Log。 ## 6.x -去[Github](https://github.com/liihuu/KLineChart/blob/v6.1.0/docs/zh-CN/CHANGELOG.md)上查看 6.x 的 Change Log。 +去 [Github](https://github.com/liihuu/KLineChart/blob/v6.1.0/docs/zh-CN/CHANGELOG.md) 上查看 6.x 的 Change Log。 ## 5.x -去[Github](https://github.com/liihuu/KLineChart/releases/tag/v5.0.0)上查看 5.x 的版本记录。 +去 [Github](https://github.com/liihuu/KLineChart/releases/tag/v5.0.0) 上查看 5.x 的版本记录。 ## 4.x -去[Github](https://github.com/liihuu/KLineChart/releases/tag/v4.0.0)上查看 4.x 的版本记录。 +去 [Github](https://github.com/liihuu/KLineChart/releases/tag/v4.0.0) 上查看 4.x 的版本记录。 diff --git a/docs/guide/v8-to-v9.md b/docs/guide/v8-to-v9.md deleted file mode 100644 index 36f892127..000000000 --- a/docs/guide/v8-to-v9.md +++ /dev/null @@ -1,52 +0,0 @@ -# 🛠️ 从 V8 到 V9 -本文档将帮助你从 klinecharts 8.x 版本升级到 klinecharts 9.x 版本,如果你是 7.x 或者更老的版本,请先参考之前的升级文档升级到 8.x。 - -## 引入调整 -不再区分`klinecharts/index.blank`和`klinecharts/index.simple`,请统一使用`import { ... } from 'klinecharts'`。 - -## 设计调整 -`shape`,`annotation`,`tag`合并成`overlay`,详情请查阅[覆盖物](./overlay.md)。 - -## 样式配置调整 -+ 所有线的样式选项`dash`,更改为`dashed`,`dashValue`更改为`dashedValue`。 -+ `candle.tooltip.labels`和`candle.tooltip.values`,合并为`candle.tooltip.custom`。 -+ `xAxis.height`变更为`xAxis.size`,`xAxis.tickText.paddingTop`变更为`xAxis.tickText.marginStart`,`xAxis.tickText.paddingBottom`变更为`xAxis.tickText.marginEnd`。 -+ `yAxis.height`变更为`yAxis.size`,`yAxis.tickText.paddingTop`变更为`yAxis.tickText.marginStart`,`yAxis.tickText.paddingBottom`变更为`yAxis.tickText.marginEnd`。 -+ `technicalIndicator.bar`变更为`indicator.bars`,`technicalIndicator.line`变更为`indicator.lines`,`technicalIndicator.circle`变更为`indicator.circles`。 -+ 删除`shape`,`annotation`,`tag`,请用`overlay`代替。 - -## API调整 - -### 图表API -+ `extension.addTechnicalIndicatorTemplate(template)`变更为`registerIndicator(template)`。 -+ 删除`extension.addShapeTemplate(template)`,请用`registerOverlay(template)`代替。 - -### 实例API -+ `getDom({ paneId, position })`变更为`getDom(paneId, position)`,参数`position`选项变更为`root`,`main`和`yAxis`。 -+ `getWidth()`和`getHeight()`合并成一个方法`getSize(paneId, position)`。 -+ `setStyleOptions(styles)`变更为`setStyles(styles)`。 -+ `getStyleOptions()`变更为`getStyles()`。 -+ `setOffsetRightSpace(space)`变更为`setOffsetRightDistance(distance)` -+ `createTechnicalIndicator(value, isStack, paneOptions)`变更为`createIndicator(value, isStack, paneOptions)` -+ `overrideTechnicalIndicator(override, paneId)`变更为`overrideIndicator(override, paneId)`。 -+ `getTechnicalIndicatorByPaneId(paneId, name)`变更为`getIndicatorByPaneId(paneId, name)`。 -+ `removeTechnicalIndicator(paneId, name)`变更为`removeIndicator(paneId, name)`。 -+ `subscribeAction(type, callback)`和`unsubscribeAction(type, callback)`,参数`type`选项变更为`onZoom`,`onScroll`,`onCrosshairChange`,`onVisibleRangeChange`和`onPaneDrag`。 -+ `convertToPixel(value, finder)`和`convertFromPixel(coordinate, finder)`,参数`finder.absoluteYAxis`变更为`finder.absolute`。 -+ 删除`createShape(value, paneId)`,`createAnnotation(annotation, paneId)`,`createTag(tag, paneId)`,请用`createOverlay(value, paneId)`代替。 -+ 删除`removeShape(id)`,`removeAnnotation(paneId, points)`,`removeTag(paneId, tagId)`,请用`removeOverlay(id)`代替。 -+ 删除`setShapeOptions(options)`,请用`overrideOverlay(override)`代替。 -+ 删除`createHtml(html, paneId)`,`removeHtml(paneId, htmlId)`,请通过`getDom(paneId, position)`获取到对应的dom后操作。 -+ 删除`getTechnicalIndicatorByPaneId(paneId, name)`。 - - -### 图形辅助API -+ 所有的API都迁移至`klinecharts.utils`。 - -## 自定义技术指标调整 -+ 属性`plots`变更为`figures`,子项方法`color`,`isStroke`,`isDashed`合并成`styles`。 -+ 方法`regeneratePlots(params)`变更为`regenerateFigures(params)`。 -+ 方法`calcTechnicalIndicator(kLineDataList, options)`变更为`calc(kLineDataList, indicator)`。 -+ 方法`createTooltipDataSource({ dataSource, viewport, crosshair, technicalIndicator, xAxis,yAxis, defaultStyles })`变更为`createTooltipDataSource({ kLineDataList, indicator, visibleRange, bounding, crosshair, defaultStyles, xAxis, yAxis })`,返回值由`[{ title: 'xxx', value: 'xxx', color: 'xxx' }, ...]`变更为`{ name: 'xxx', calcParamsText: 'xxx', values: [{ title: 'xxx', value: 'xxx', color: 'xxx' }, ...] }`。 -+ 方法`render({ ctx, dataSource, viewport, styles,xAxis, yAxis })`变更为`draw({ ctx, kLineDataList, indicator, visibleRange, bounding, barSpace, defaultStyles, xAxis, yAxis })`。 -+ 删除属性`shouldCheckParamCount`。 diff --git a/docs/guide/v9-to-v10.md b/docs/guide/v9-to-v10.md new file mode 100644 index 000000000..ef3f5b405 --- /dev/null +++ b/docs/guide/v9-to-v10.md @@ -0,0 +1,25 @@ +# 🛠️ 从 V9 到 V10 +本文档将帮助你从 klinecharts 9.x 版本升级到 klinecharts 10.x 版本,如果你是 8.x 或者更老的版本,请先参考 [v8 到 v9](https://v9.klinecharts.com/guide/v8-to-v9) 升级到 9.x。 + +## 样式配置调整 ++ 删除 `yAxis.position` , `yAxis.type` , `yAxis.inside` 和 `yAxis.inside` ,请使用窗口配置 `axis` 中的属性代替。详情参阅图表API [init(dcs, options)](/api/chart/init#parameters) ,实例API [createIndicator(value, isStack, paneOptions)](/api/instance/createIndicator#parameters) 和 [setPaneOptions(options)](/api/instance/setPaneOptions#parameters) 。 ++ 删除 `overlay.rectText` 。 + +## API调整 + +### 图表API ++ 删除 `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)`,请使用 `getFigureClass(name)` 代替。 ++ `init(dcs, options)` , `options.layout` 子项中的 `position` 变更为 `order` , `options.customApi` 中的 `formatDate(dateTimeFormat, timestamp, format, type)` 变更为 `formatDate(timestamp, format, type)` , `options.thousandsSeparator` 变更为对象 `{ sign, format }` , `options.decimalFoldThreshold` 变更为 `options.decimalFold` 。 + +### 实例API ++ 删除 `setPriceVolumePrecision(pricePrecision, volumePrecision)` ,请使用 `setPrecision(precision)` 代替。 ++ 删除 `applyMoreData(dataList, more, callback)` , `setLoadDataCallback(cb)` 和 `loadMore(cb)` ,请使用 `setLoadMoreDataCallback(cb)` 代替。 ++ 删除 `getIndicatorByPaneId(paneId, name)` ,请使用 `getIndicators(filter)` 代替。 ++ 删除 `getOverlayById(id)` ,请使用 `getOverlays(filter)` 代替。 ++ `applyNewData(dataList, more, callback)` 变更为 `applyNewData(dataList, more)` 。 ++ `updateData(data, callback)` 变更为 `updateData(data)` 。 ++ `getBarSpace()` 返回值变更为对象。 + +## 自定义扩展调整 ++ 指标 `createTooltipDataSource` 方法返回值 `values` 变更为 `legends` 。 ++ 删除内置的基础图形 `rectText` ,请使用 `text` 代替。 diff --git a/package.json b/package.json index b1028150e..3b3164bc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "klinecharts", - "version": "9.8.10", + "version": "10.0.0-alpha1", "description": "Lightweight k-line chart built with html5 canvas", "main": "./dist/index.cjs", "module": "./dist/index.esm.js",