From 07f19517a30f3dac06bab0fcd50df8aab0c3feb3 Mon Sep 17 00:00:00 2001 From: liihuu Date: Mon, 4 Mar 2024 00:04:56 +0800 Subject: [PATCH] docs: update docs --- docs/en-US/guide/changelog.md | 8 ++++++++ docs/en-US/guide/chart-api.md | 10 +++++----- docs/en-US/guide/custom-axis.md | 2 +- docs/en-US/guide/instance-api.md | 28 ++++++++++++++-------------- docs/guide/changelog.md | 8 ++++++++ docs/guide/chart-api.md | 10 +++++----- docs/guide/custom-axis.md | 2 +- docs/guide/instance-api.md | 28 ++++++++++++++-------------- 8 files changed, 56 insertions(+), 40 deletions(-) diff --git a/docs/en-US/guide/changelog.md b/docs/en-US/guide/changelog.md index 3f3e7ac9c..3d596f95a 100644 --- a/docs/en-US/guide/changelog.md +++ b/docs/en-US/guide/changelog.md @@ -1,5 +1,13 @@ # 📠 Change Log +## 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. diff --git a/docs/en-US/guide/chart-api.md b/docs/en-US/guide/chart-api.md index 33048e46f..f937b6019 100644 --- a/docs/en-US/guide/chart-api.md +++ b/docs/en-US/guide/chart-api.md @@ -39,7 +39,7 @@ Initialize a chart and return the chart instance. - `ds` container, can be dom element or element id. - `options` optional configuration items. - - `layout` custom layout, `content` and `options` refer to the input parameters `value` and `options` in the instance api [createIndicator](./instance-api#createindicator-value-isstack-paneoptions-callback). + - `layout` custom layout, `content` and `options` refer to the input parameters `value` and `options` in the instance api [createIndicator](./instance-api#createindicator-value-isstack-paneoptions-callback). v9.6.0+ - `locale` language, built-in support for `zh-CN` and `en-US`. - `timezone` time zone name, such as 'Asia/Shanghai', if not set, it will automatically get the local time zone, please refer to [timezone list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List ). - `styles` It can be the style name registered through `klinecharts.registerStyles`, or it can be an object, a list of styles, see [styles](./styles.md) for details, and supports increments. @@ -47,7 +47,7 @@ Initialize a chart and return the chart instance. - `formatDate` formats a date. - `formatBigNumber` format big numbers, such as 1000 into 1k, 1000000 into 1M, etc.\ - `thousandsSeparator` thousands separator - - `decimalFoldThreshold` decimal fold threshold + - `decimalFoldThreshold` decimal fold threshold v9.8.0+ ## dispose(dcs) @@ -312,7 +312,7 @@ Add a overlay. - `needDefaultXAxisFigure` needs the default x-axis figure - `needDefaultYAxisFigure` needs the default y-axis figure - `mode` mode, options are 'normal', 'weak_magnet' and 'strong_magnet' - - `modeSensitivity` mode sensitivity, only valid when mode is weak_magnet + - `modeSensitivity` mode sensitivity, only valid when mode is weak_magnet v9.5.0+ - `points` point information - `extendData` extended data - `styles` styles @@ -325,7 +325,7 @@ Add a overlay. - `onDrawing` drawing event - `onDrawEnd` draw end event - `onClick` click event - - `onDoubleClick` double click event + - `onDoubleClick` double click event v9.5.0+ - `onRightClick` right click event - `onPressedMoveStart` press start move event - `onPressedMoving` Press and move event @@ -471,7 +471,7 @@ Format thousands separator. Format fold decimal. -### utils.calcTextWidth(text, size, weight, family) +### utils.calcTextWidth(text, size, weight, family) v9.3.0+ ```typescript (text: string, size?: number, weight?: string | number, family?: string) => number ``` diff --git a/docs/en-US/guide/custom-axis.md b/docs/en-US/guide/custom-axis.md index 4861f68a4..220ee48ac 100644 --- a/docs/en-US/guide/custom-axis.md +++ b/docs/en-US/guide/custom-axis.md @@ -1,4 +1,4 @@ -# Custom Axis +# Custom Axis v9.8.0+ Chart support custom axis, which can be achieved through the chart api [registerXAxis(axis)](./chart-api#registerxaxis-axis) and [registerYAxis(axis)](./chart-api#registeryaxis-axis). diff --git a/docs/en-US/guide/instance-api.md b/docs/en-US/guide/instance-api.md index 3bd9bb6df..18438762b 100644 --- a/docs/en-US/guide/instance-api.md +++ b/docs/en-US/guide/instance-api.md @@ -98,21 +98,21 @@ Whether dragging and scrolling is possible. ``` Set the gap that can be left to the right of the chart. -## getOffsetRightDistance() +## getOffsetRightDistance() v9.2.0+ ```typescript () => number ``` Get the gap that can be left to the right of the chart. -## setMaxOffsetLeftDistance() +## setMaxOffsetLeftDistance() v9.7.0+ ```typescript (distance: number) => void ``` Set the maximum available gap on the left side of the chart. -## setMaxOffsetRightDistance() +## setMaxOffsetRightDistance() v9.7.0+ ```typescript (distance: number) => void ``` @@ -177,7 +177,7 @@ Get visible range. Add new data, this method will clear the chart data, no need to call the clearData method additionally. - `dataList` is an array of K-line data. For details of the data type, please refer to [data](./datasource.md) - `more` tells the chart whether there is more historical data, can be defaulted, the default is true -- `callback` success callback +- `callback` success callback v9.2.0+ ::: warning Note `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady', () => {})` instead. ::: @@ -202,7 +202,7 @@ Add new data, this method will clear the chart data, no need to call the clearDa Add more historical data. - `dataList` is an array of K-line data. For details of the data type, please refer to [data](./datasource.md) - `more` tells the chart whether there is more historical data, can be defaulted, the default is true -- `callback` success callback +- `callback` success callback v9.2.0+ ::: warning Note This api has been deprecated since version 9.8.0. ::: @@ -225,7 +225,7 @@ This api has been deprecated since version 9.8.0. ``` Update data. Currently, only the timestamp of the last piece of data will be matched. If it is the same, it will be overwritten, and if it is different, it will be appended. - `data` single k-line data, please refer to [data](./datasource.md) for details of data type -- `callback` success callback +- `callback` success callback v9.2.0+ ::: warning Note `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady', () => {})` instead. ::: @@ -370,13 +370,13 @@ Create a technical indicator, the return value is a string that identifies the w - `height` window height, can be default - `minHeight` minimum height of the window, can be defaulted - `dragEnabled` Whether the window can be dragged to adjust the height, it can be defaulted - - `position` Only valid when creating a new pane + - `position` Only valid when creating a new pane v9.6.0+ - `gap` margins - `top` top margin, value less than 1 is a percentage - `bottom` bottom margin, value less than 1 is a percentage - `axisOptions` - `name` is same `axis.name` in [registerYAxis(axis)](./chart-api#registeryaxis-axis) of chart api, default is 'default' v9.8.0+ - - `scrollZoomEnabled` Scroll zoom flag + - `scrollZoomEnabled` Scroll zoom flag v9.3.0+ - `callback` success callback ::: tip Special id 'candle_pane', the window id of the main picture. @@ -463,7 +463,7 @@ Overlay technical indicator information. - `shouldOhlc` needs ohlc auxiliary graphics - `shouldFormatBigNumber` should format large numbers. For example, 1000 is converted to 1k, 1000000 is converted to 1M, etc. - `visible` visible or not - - `zLevel` z level + - `zLevel` z level v9.7.0+ - `extendData` extended data - `series` indicator series, optional options are 'normal', 'price' and 'volume' - `figures` graphics configuration @@ -737,7 +737,7 @@ Overlays that have been drawn. - `needDefaultXAxisFigure` needs the default x-axis figure - `needDefaultYAxisFigure` needs the default y-axis figure - `mode` mode, options are 'normal', 'weak_magnet' and 'strong_magnet' - - `modeSensitivity` mode sensitivity, only valid when mode is weak_magnet + - `modeSensitivity` mode sensitivity, only valid when mode is weak_magnet v9.5.0+ - `points` point information - `extendData` extended data - `styles` styles @@ -745,7 +745,7 @@ Overlays that have been drawn. - `onDrawing` drawing event - `onDrawEnd` draw end event - `onClick` click event - - `onDoubleClick` double click event + - `onDoubleClick` double click event v9.5.0+ - `onRightClick` right click event - `onPressedMoveStart` press start move event - `onPressedMoving` Press and move event @@ -919,8 +919,8 @@ Set window configuration. - `top` top margin, value less than 1 is a percentage - `bottom` bottom margin, value less than 1 is a percentage - `axisOptions` - - `name` axis name - - `scrollZoomEnabled` Scroll zoom flag + - `name` axis name v9.8.0+ + - `scrollZoomEnabled` Scroll zoom flag v9.3.0+ ::: tip Special id 'candle_pane', the window id of the main picture. ::: @@ -937,7 +937,7 @@ chart.setPaneOptions({ }) ``` -## executeAction(type, data) +## executeAction(type, data) v9.2.0+ ```typescript ( type: 'onCrosshairChange', diff --git a/docs/guide/changelog.md b/docs/guide/changelog.md index eb50f68c8..ebff2df14 100644 --- a/docs/guide/changelog.md +++ b/docs/guide/changelog.md @@ -1,5 +1,13 @@ # 📠 更新日志 +## 9.8.0 +`2024-03-04` ++ 🆕 支持自定义坐标轴。 ++ 🆕 支持指标绘制到未来时间。 ++ 🆕 支持长小数折叠。 ++ 🆕 支持向前和向后添加数据。 ++ 🐞 修复不同浏览器格式化时间问题。 + ## 9.7.2 `2024-01-12` + 🐞 修复指标属性 `minValue` 和 `maxValue` 不生效问题。 diff --git a/docs/guide/chart-api.md b/docs/guide/chart-api.md index ac7145d2a..c1102abb2 100644 --- a/docs/guide/chart-api.md +++ b/docs/guide/chart-api.md @@ -39,7 +39,7 @@ 初始化一个图表,返回图表实例。 - `ds` 容器,可以是dom元素或者元素id。 - `options` 可选配置项。 - - `layout` 自定义布局,`content`中的内容和`options`参考实例方法 [createIndicator](./instance-api#createindicator-value-isstack-paneoptions-callback) 中的入参`value`和`options`。 + - `layout` 自定义布局,`content`中的内容和`options`参考实例方法 [createIndicator](./instance-api#createindicator-value-isstack-paneoptions-callback) 中的入参`value`和`options`。 v9.6.0+ - `locale` 语言,内置支持`zh-CN`和`en-US`。 - `timezone` 时区名,如'Asia/Shanghai',如果不设置会自动获取本机时区,时区对应名字列表请参阅[时区列表](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List)。 - `styles` 可以是通过`klinecharts.registerStyles`注册的样式名,也可以是object,样式列表,详情参阅[样式](./styles.md),支持增量。 @@ -47,7 +47,7 @@ - `formatDate` 格式化日期。 - `formatBigNumber` 格式化大的数字,如1000转换成1k,1000000转换为1M等。 - `thousandsSeparator` 千分符 - - `decimalFoldThreshold` 小数折叠阈值 + - `decimalFoldThreshold` 小数折叠阈值 v9.8.0+ ## dispose(dcs) @@ -315,7 +315,7 @@ - `needDefaultXAxisFigure` 是否需要默认的x轴上的图形 - `needDefaultYAxisFigure` 是否需要默认的y轴上的图形 - `mode` 模式,可选项有'normal','weak_magnet'和'strong_magnet' - - `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效 + - `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效 v9.5.0+ - `points` 点信息 - `extendData` 扩展数据 - `styles` 样式 @@ -328,7 +328,7 @@ - `onDrawing` 绘制中事件 - `onDrawEnd` 绘制结束事件 - `onClick` 点击事件 - - `onDoubleClick` 双击事件 + - `onDoubleClick` 双击事件 v9.5.0+ - `onRightClick` 右击事件 - `onPressedMoveStart` 按住开始移动事件 - `onPressedMoving` 按住移动中事件 @@ -474,7 +474,7 @@ 格式化折叠小数。 -### utils.calcTextWidth(text, size, weight, family) +### utils.calcTextWidth(text, size, weight, family) v9.3.0+ ```typescript (text: string, size?: number, weight?: string | number, family?: string) => number ``` diff --git a/docs/guide/custom-axis.md b/docs/guide/custom-axis.md index e2afc11df..ad7937e19 100644 --- a/docs/guide/custom-axis.md +++ b/docs/guide/custom-axis.md @@ -1,4 +1,4 @@ -# 自定义坐标轴 +# 自定义坐标轴 v9.8.0+ 图表支持自定义坐标轴,可以通过图表方法 [registerXAxis(axis)](./chart-api#registerxaxis-axis) 和 [registerYAxis(axis)](./chart-api#registeryaxis-axis) 来实现。 diff --git a/docs/guide/instance-api.md b/docs/guide/instance-api.md index d78a36bb4..3dc80b65c 100644 --- a/docs/guide/instance-api.md +++ b/docs/guide/instance-api.md @@ -99,21 +99,21 @@ 设置图表右边可以空出来的间隙。 -## getOffsetRightDistance() +## getOffsetRightDistance() v9.2.0+ ```typescript () => number ``` 获取图表右边可以空出来的间隙。 -## setMaxOffsetLeftDistance() +## setMaxOffsetLeftDistance() v9.7.0+ ```typescript (distance: number) => void ``` 设置图表左边最大可空出来的间隙。 -## setMaxOffsetRightDistance() +## setMaxOffsetRightDistance() v9.7.0+ ```typescript (distance: number) => void ``` @@ -178,7 +178,7 @@ 添加新数据,此方法会清空图表数据,不需要额外调用clearData方法。 - `dataList` 是一个K线数据数组,数据类型详情可参阅[数据源](./datasource.md) - `more` 告诉图表还有没有更多历史数据,可缺省,默认为true -- `callback` 成功回调 +- `callback` 成功回调 v9.2.0+ ::: warning 注意 参数 `callback` 自版本9.8.0开始,已废弃,请使用 `subscribeAction('onDataReady', () => {})` 代替。 ::: @@ -203,7 +203,7 @@ 添加历史更多数据。 - `dataList` 是一个K线数据数组,数据类型详情可参阅[数据源](./datasource.md) - `more` 告诉图表还有没有更多历史数据,可缺省,默认为true -- `callback` 成功回调 +- `callback` 成功回调 v9.2.0+ ::: warning 注意 该方法自版本9.8.0开始,已废弃。 ::: @@ -226,7 +226,7 @@ ``` 更新数据,目前只会匹配当前最后一条数据的时间戳,相同则覆盖,不同则追加。 - `data` 单条k线数据,数据类型详情可参阅[数据源](./datasource.md) -- `callback` 成功回调 +- `callback` 成功回调 v9.2.0+ ::: warning 注意 参数 `callback` 自版本9.8.0开始,已废弃,请使用 `subscribeAction('onDataReady', () => {})` 代替。 ::: @@ -371,13 +371,13 @@ - `height` 窗口高度,可缺省 - `minHeight` 窗口最小高度,可缺省 - `dragEnabled` 窗口是否可以拖拽调整高度,可缺省 - - `position` 位置,仅仅在创建新的窗口时有效 + - `position` 位置,仅仅在创建新的窗口时有效 v9.6.0+ - `gap` 边距 - `top` 上边距,值小余1则是百分比 - `bottom` 下边距,值小余1则是百分比 - `axisOptions` - `name` 指定的轴的名字,此参数对应图表实例方法 [registerYAxis(axis)](./chart-api#registeryaxis-axis) 中的 `axis.name`,默认为 'default' v9.8.0+ - - `scrollZoomEnabled` 轴上是否可以滚动缩放 + - `scrollZoomEnabled` 轴上是否可以滚动缩放 v9.3.0+ - `callback` 指标创建完成回调方法 ::: tip 特殊的id @@ -472,7 +472,7 @@ chart.createIndicator('MA', false, { - `shouldOhlc` 是否需要ohlc辅助图形 - `shouldFormatBigNumber` 是否需要格式化大的数字。如1000转换成1k,1000000转换为1M等 - `visible` 是否可见 - - `zLevel` 层级 + - `zLevel` 层级 v9.7.0+ - `extendData` 扩展数据 - `series` 指标系列,可选项有'normal','price'和'volume' - `figures` 图形配置 @@ -749,7 +749,7 @@ chart.createOverlay({ - `needDefaultXAxisFigure` 是否需要默认的x轴上的图形 - `needDefaultYAxisFigure` 是否需要默认的y轴上的图形 - `mode` 模式,可选项有'normal','weak_magnet'和'strong_magnet' - - `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效 + - `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效 v9.5.0+ - `points` 点信息 - `extendData` 扩展数据 - `styles` 样式 @@ -757,7 +757,7 @@ chart.createOverlay({ - `onDrawing` 绘制中事件 - `onDrawEnd` 绘制结束事件 - `onClick` 点击事件 - - `onDoubleClick` 双击事件 + - `onDoubleClick` 双击事件 v9.5.0+ - `onRightClick` 右击事件 - `onPressedMoveStart` 按住开始移动事件 - `onPressedMoving` 按住移动中事件 @@ -936,8 +936,8 @@ chart.overrideOverlay({ - `top` 上边距,值小余1则是百分比 - `bottom` 下边距,值小余1则是百分比 - `axisOptions` - - `name` 轴名字 - - `scrollZoomEnabled` 轴上是否可以滚动缩放 + - `name` 轴名字 v9.8.0+ + - `scrollZoomEnabled` 轴上是否可以滚动缩放 v9.3.0+ ::: tip 特殊的id 'candle_pane',主图的窗口id。 ::: @@ -954,7 +954,7 @@ chart.setPaneOptions({ }) ``` -## executeAction(type, data) +## executeAction(type, data) v9.2.0+ ```typescript ( type: 'onCrosshairChange',