Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Mar 3, 2024
1 parent 58c9c6f commit 07f1951
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 40 deletions.
8 changes: 8 additions & 0 deletions docs/en-US/guide/changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions docs/en-US/guide/chart-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
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). <Tag>v9.6.0+</Tag>
- `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.
- `customApi` customize some APIs.
- `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 <Tag>v9.8.0+</Tag>


## dispose(dcs)
Expand Down Expand Up @@ -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 <Tag>v9.5.0+</Tag>
- `points` point information
- `extendData` extended data
- `styles` styles
Expand All @@ -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 <Tag>v9.5.0+</Tag>
- `onRightClick` right click event
- `onPressedMoveStart` press start move event
- `onPressedMoving` Press and move event
Expand Down Expand Up @@ -471,7 +471,7 @@ Format thousands separator.
Format fold decimal.


### utils.calcTextWidth(text, size, weight, family)
### utils.calcTextWidth(text, size, weight, family) <Tag>v9.3.0+</Tag>
```typescript
(text: string, size?: number, weight?: string | number, family?: string) => number
```
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/guide/custom-axis.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Custom Axis
# Custom Axis <Tag>v9.8.0+</Tag>

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).

Expand Down
28 changes: 14 additions & 14 deletions docs/en-US/guide/instance-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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() <Tag>v9.2.0+</Tag>
```typescript
() => number
```
Get the gap that can be left to the right of the chart.


## setMaxOffsetLeftDistance()
## setMaxOffsetLeftDistance() <Tag>v9.7.0+</Tag>
```typescript
(distance: number) => void
```
Set the maximum available gap on the left side of the chart.


## setMaxOffsetRightDistance()
## setMaxOffsetRightDistance() <Tag>v9.7.0+</Tag>
```typescript
(distance: number) => void
```
Expand Down Expand Up @@ -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 <Tag>v9.2.0+</Tag>
::: warning Note
`callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady', () => {})` instead.
:::
Expand All @@ -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 <Tag>v9.2.0+</Tag>
::: warning Note
This api has been deprecated since version 9.8.0.
:::
Expand All @@ -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 <Tag>v9.2.0+</Tag>
::: warning Note
`callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady', () => {})` instead.
:::
Expand Down Expand Up @@ -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 <Tag>v9.6.0+</Tag>
- `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' <Tag>v9.8.0+</Tag>
- `scrollZoomEnabled` Scroll zoom flag
- `scrollZoomEnabled` Scroll zoom flag <Tag>v9.3.0+</Tag>
- `callback` success callback
::: tip Special id
'candle_pane', the window id of the main picture.
Expand Down Expand Up @@ -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 <Tag>v9.7.0+</Tag>
- `extendData` extended data
- `series` indicator series, optional options are 'normal', 'price' and 'volume'
- `figures` graphics configuration
Expand Down Expand Up @@ -737,15 +737,15 @@ 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 <Tag>v9.5.0+</Tag>
- `points` point information
- `extendData` extended data
- `styles` styles
- `onDrawStart` start drawing event
- `onDrawing` drawing event
- `onDrawEnd` draw end event
- `onClick` click event
- `onDoubleClick` double click event
- `onDoubleClick` double click event <Tag>v9.5.0+</Tag>
- `onRightClick` right click event
- `onPressedMoveStart` press start move event
- `onPressedMoving` Press and move event
Expand Down Expand Up @@ -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 <Tag>v9.8.0+</Tag>
- `scrollZoomEnabled` Scroll zoom flag <Tag>v9.3.0+</Tag>
::: tip Special id
'candle_pane', the window id of the main picture.
:::
Expand All @@ -937,7 +937,7 @@ chart.setPaneOptions({
})
```

## executeAction(type, data)
## executeAction(type, data) <Tag>v9.2.0+</Tag>
```typescript
(
type: 'onCrosshairChange',
Expand Down
8 changes: 8 additions & 0 deletions docs/guide/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# 📠 更新日志

## 9.8.0
`2024-03-04`
+ 🆕 支持自定义坐标轴。
+ 🆕 支持指标绘制到未来时间。
+ 🆕 支持长小数折叠。
+ 🆕 支持向前和向后添加数据。
+ 🐞 修复不同浏览器格式化时间问题。

## 9.7.2
`2024-01-12`
+ 🐞 修复指标属性 `minValue``maxValue` 不生效问题。
Expand Down
10 changes: 5 additions & 5 deletions docs/guide/chart-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
初始化一个图表,返回图表实例。
- `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` <Tag>v9.6.0+</Tag>
- `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),支持增量。
- `customApi` 自定义一些api。
- `formatDate` 格式化日期。
- `formatBigNumber` 格式化大的数字,如1000转换成1k,1000000转换为1M等。
- `thousandsSeparator` 千分符
- `decimalFoldThreshold` 小数折叠阈值
- `decimalFoldThreshold` 小数折叠阈值 <Tag>v9.8.0+</Tag>


## dispose(dcs)
Expand Down Expand Up @@ -315,7 +315,7 @@
- `needDefaultXAxisFigure` 是否需要默认的x轴上的图形
- `needDefaultYAxisFigure` 是否需要默认的y轴上的图形
- `mode` 模式,可选项有'normal','weak_magnet'和'strong_magnet'
- `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效
- `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效 <Tag>v9.5.0+</Tag>
- `points` 点信息
- `extendData` 扩展数据
- `styles` 样式
Expand All @@ -328,7 +328,7 @@
- `onDrawing` 绘制中事件
- `onDrawEnd` 绘制结束事件
- `onClick` 点击事件
- `onDoubleClick` 双击事件
- `onDoubleClick` 双击事件 <Tag>v9.5.0+</Tag>
- `onRightClick` 右击事件
- `onPressedMoveStart` 按住开始移动事件
- `onPressedMoving` 按住移动中事件
Expand Down Expand Up @@ -474,7 +474,7 @@
格式化折叠小数。


### utils.calcTextWidth(text, size, weight, family)
### utils.calcTextWidth(text, size, weight, family) <Tag>v9.3.0+</Tag>
```typescript
(text: string, size?: number, weight?: string | number, family?: string) => number
```
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/custom-axis.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 自定义坐标轴
# 自定义坐标轴 <Tag>v9.8.0+</Tag>

图表支持自定义坐标轴,可以通过图表方法 [registerXAxis(axis)](./chart-api#registerxaxis-axis)[registerYAxis(axis)](./chart-api#registeryaxis-axis) 来实现。

Expand Down
28 changes: 14 additions & 14 deletions docs/guide/instance-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@
设置图表右边可以空出来的间隙。


## getOffsetRightDistance()
## getOffsetRightDistance() <Tag>v9.2.0+</Tag>
```typescript
() => number
```
获取图表右边可以空出来的间隙。


## setMaxOffsetLeftDistance()
## setMaxOffsetLeftDistance() <Tag>v9.7.0+</Tag>
```typescript
(distance: number) => void
```
设置图表左边最大可空出来的间隙。


## setMaxOffsetRightDistance()
## setMaxOffsetRightDistance() <Tag>v9.7.0+</Tag>
```typescript
(distance: number) => void
```
Expand Down Expand Up @@ -178,7 +178,7 @@
添加新数据,此方法会清空图表数据,不需要额外调用clearData方法。
- `dataList` 是一个K线数据数组,数据类型详情可参阅[数据源](./datasource.md)
- `more` 告诉图表还有没有更多历史数据,可缺省,默认为true
- `callback` 成功回调
- `callback` 成功回调 <Tag>v9.2.0+</Tag>
::: warning 注意
参数 `callback` 自版本9.8.0开始,已废弃,请使用 `subscribeAction('onDataReady', () => {})` 代替。
:::
Expand All @@ -203,7 +203,7 @@
添加历史更多数据。
- `dataList` 是一个K线数据数组,数据类型详情可参阅[数据源](./datasource.md)
- `more` 告诉图表还有没有更多历史数据,可缺省,默认为true
- `callback` 成功回调
- `callback` 成功回调 <Tag>v9.2.0+</Tag>
::: warning 注意
该方法自版本9.8.0开始,已废弃。
:::
Expand All @@ -226,7 +226,7 @@
```
更新数据,目前只会匹配当前最后一条数据的时间戳,相同则覆盖,不同则追加。
- `data` 单条k线数据,数据类型详情可参阅[数据源](./datasource.md)
- `callback` 成功回调
- `callback` 成功回调 <Tag>v9.2.0+</Tag>
::: warning 注意
参数 `callback` 自版本9.8.0开始,已废弃,请使用 `subscribeAction('onDataReady', () => {})` 代替。
:::
Expand Down Expand Up @@ -371,13 +371,13 @@
- `height` 窗口高度,可缺省
- `minHeight` 窗口最小高度,可缺省
- `dragEnabled` 窗口是否可以拖拽调整高度,可缺省
- `position` 位置,仅仅在创建新的窗口时有效
- `position` 位置,仅仅在创建新的窗口时有效 <Tag>v9.6.0+</Tag>
- `gap` 边距
- `top` 上边距,值小余1则是百分比
- `bottom` 下边距,值小余1则是百分比
- `axisOptions`
- `name` 指定的轴的名字,此参数对应图表实例方法 [registerYAxis(axis)](./chart-api#registeryaxis-axis) 中的 `axis.name`,默认为 'default' <Tag>v9.8.0+</Tag>
- `scrollZoomEnabled` 轴上是否可以滚动缩放
- `scrollZoomEnabled` 轴上是否可以滚动缩放 <Tag>v9.3.0+</Tag>

- `callback` 指标创建完成回调方法
::: tip 特殊的id
Expand Down Expand Up @@ -472,7 +472,7 @@ chart.createIndicator('MA', false, {
- `shouldOhlc` 是否需要ohlc辅助图形
- `shouldFormatBigNumber` 是否需要格式化大的数字。如1000转换成1k,1000000转换为1M等
- `visible` 是否可见
- `zLevel` 层级
- `zLevel` 层级 <Tag>v9.7.0+</Tag>
- `extendData` 扩展数据
- `series` 指标系列,可选项有'normal','price'和'volume'
- `figures` 图形配置
Expand Down Expand Up @@ -749,15 +749,15 @@ chart.createOverlay({
- `needDefaultXAxisFigure` 是否需要默认的x轴上的图形
- `needDefaultYAxisFigure` 是否需要默认的y轴上的图形
- `mode` 模式,可选项有'normal','weak_magnet'和'strong_magnet'
- `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效
- `modeSensitivity` 模式灵敏度,仅 mode 是 weak_magnet 时有效 <Tag>v9.5.0+</Tag>
- `points` 点信息
- `extendData` 扩展数据
- `styles` 样式
- `onDrawStart` 开始绘制事件
- `onDrawing` 绘制中事件
- `onDrawEnd` 绘制结束事件
- `onClick` 点击事件
- `onDoubleClick` 双击事件
- `onDoubleClick` 双击事件 <Tag>v9.5.0+</Tag>
- `onRightClick` 右击事件
- `onPressedMoveStart` 按住开始移动事件
- `onPressedMoving` 按住移动中事件
Expand Down Expand Up @@ -936,8 +936,8 @@ chart.overrideOverlay({
- `top` 上边距,值小余1则是百分比
- `bottom` 下边距,值小余1则是百分比
- `axisOptions`
- `name` 轴名字
- `scrollZoomEnabled` 轴上是否可以滚动缩放
- `name` 轴名字 <Tag>v9.8.0+</Tag>
- `scrollZoomEnabled` 轴上是否可以滚动缩放 <Tag>v9.3.0+</Tag>
::: tip 特殊的id
'candle_pane',主图的窗口id。
:::
Expand All @@ -954,7 +954,7 @@ chart.setPaneOptions({
})
```

## executeAction(type, data)
## executeAction(type, data) <Tag>v9.2.0+</Tag>
```typescript
(
type: 'onCrosshairChange',
Expand Down

0 comments on commit 07f1951

Please sign in to comment.