Skip to content

Commit 9a9f7bd

Browse files
committed
docs: changelog
1 parent 1a067d3 commit 9a9f7bd

File tree

6 files changed

+147
-50
lines changed

6 files changed

+147
-50
lines changed

docs/@views/styles/config.md

Lines changed: 96 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,27 @@ const styles = {
106106
weight: 'normal',
107107
borderRadius: 2
108108
}
109+
// e.g.
110+
// [{
111+
// show: true,
112+
// style: 'fill', // 'fill' | 'stroke' | 'stroke_fill'
113+
// position: 'above_price', // 'above_price' | 'below_price'
114+
// updateInterval: 0,
115+
// size: 12,
116+
// paddingLeft: 4,
117+
// paddingTop: 4,
118+
// paddingRight: 4,
119+
// paddingBottom: 4,
120+
// borderStyle: 'solid', // 'solid' | 'dashed'
121+
// borderSize: 0,
122+
// borderColor: 'transparent',
123+
// borderDashedValue: [2, 2],
124+
// color: '#FFFFFF',
125+
// family: 'Helvetica Neue',
126+
// weight: 'normal',
127+
// borderRadius: 2
128+
// }]
129+
extendTexts: []
109130
}
110131
},
111132
tooltip: {
@@ -117,20 +138,8 @@ const styles = {
117138
showRule: 'always',
118139
// 'standard' | 'rect'
119140
showType: 'standard',
120-
// e.g.
121-
// [{ title: 'time', value: '{time}' }, { title: 'close', value: '{close}' }]
122-
// [{ title: { text: 'time', color: '#fff' }, value: { text: '{time}', color: '#fff' } }, { title: 'close', value: '{close}' }]
123-
custom: [
124-
{ title: 'time', value: '{time}' },
125-
{ title: 'open', value: '{open}' },
126-
{ title: 'high', value: '{high}' },
127-
{ title: 'low', value: '{low}' },
128-
{ title: 'close', value: '{close}' },
129-
{ title: 'volume', value: '{volume}' }
130-
],
131-
defaultValue: 'n/a',
132141
rect: {
133-
// 'fixed' | 'pointer'
142+
// 'fixed' | 'pointer'
134143
position: 'fixed',
135144
paddingLeft: 4,
136145
paddingRight: 4,
@@ -145,20 +154,44 @@ const styles = {
145154
borderColor: '#f2f3f5',
146155
color: '#FEFEFE'
147156
},
148-
text: {
157+
title: {
158+
show: true,
159+
size: 14,
160+
family: 'Helvetica Neue',
161+
weight: 'normal',
162+
color: Color.GREY,
163+
marginLeft: 8,
164+
marginTop: 4,
165+
marginRight: 8,
166+
marginBottom: 4,
167+
template: '{ticker} · {period}'
168+
},
169+
legend: {
149170
size: 12,
150171
family: 'Helvetica Neue',
151172
weight: 'normal',
152-
color: '#D9D9D9',
173+
color: '#76808F',
153174
marginLeft: 8,
154175
marginTop: 4,
155176
marginRight: 8,
156-
marginBottom: 4
177+
marginBottom: 4,
178+
defaultValue: 'n/a',
179+
// e.g.
180+
// [{ title: 'time', value: '{time}' }, { title: 'close', value: '{close}' }]
181+
// [{ title: { text: 'time', color: '#fff' }, value: { text: '{time}', color: '#fff' } }, { title: 'close', value: '{close}' }]
182+
template: [
183+
{ title: 'time', value: '{time}' },
184+
{ title: 'open', value: '{open}' },
185+
{ title: 'high', value: '{high}' },
186+
{ title: 'low', value: '{low}' },
187+
{ title: 'close', value: '{close}' },
188+
{ title: 'volume', value: '{volume}' }
189+
]
157190
},
158191
// e.g.
159192
// [{
160193
// id: 'icon_id',
161-
// position: 'left', // 'left', 'middle', 'right'
194+
// position: 'left', // 'left' | 'middle' | 'right'
162195
// marginLeft: 8,
163196
// marginTop: 6,
164197
// marginRight: 0,
@@ -173,14 +206,10 @@ const styles = {
173206
// backgroundColor: 'rgba(33, 150, 243, 0.2)',
174207
// activeBackgroundColor: 'rgba(33, 150, 243, 0.4)',
175208
// type: 'path', // 'path', 'icon_font'
176-
// path: {
209+
// content: {
177210
// style: 'stroke', // 'stroke', 'fill'
178211
// path: 'M6.81029,6.02908L11.7878,1.02746C12.0193,0.79483,12.0193,0.445881,11.7878,0.213247C11.5563,-0.019386,11.209,-0.019386,10.9775,0.213247L6,5.21486L1.02251,0.174475C0.790997,-0.0581583,0.44373,-0.0581583,0.212219,0.174475C-0.0192925,0.407108,-0.0192925,0.756058,0.212219,0.988691L5.18971,6.02908L0.173633,11.0307C-0.0578778,11.2633,-0.0578778,11.6123,0.173633,11.8449C0.289389,11.9612,0.44373,12,0.598071,12C0.752411,12,0.906752,11.9612,1.02251,11.8449L6,6.8433L10.9775,11.8449C11.0932,11.9612,11.2476,12,11.4019,12C11.5563,12,11.7106,11.9612,11.8264,11.8449C12.0579,11.6123,12.0579,11.2633,11.8264,11.0307L6.81029,6.02908Z',
179212
// lineWidth: 1,
180-
// },
181-
// iconFont: {
182-
// content: '\ue900',
183-
// family: 'iconfont'
184213
// }
185214
// }]
186215
features: []
@@ -280,23 +309,34 @@ const styles = {
280309
showRule: 'always',
281310
// 'standard' | 'rect'
282311
showType: 'standard',
283-
showName: true,
284-
showParams: true,
285-
defaultValue: 'n/a',
286-
text: {
312+
title: {
313+
show: true,
314+
showName: true,
315+
showParams: true,
287316
size: 12,
288317
family: 'Helvetica Neue',
289318
weight: 'normal',
290-
color: '#D9D9D9',
319+
color: '#76808F',
320+
marginLeft: 8,
321+
marginTop: 4,
322+
marginRight: 8,
323+
marginBottom: 4
324+
},
325+
legend: {
326+
size: 12,
327+
family: 'Helvetica Neue',
328+
weight: 'normal',
329+
color: '#76808F',
330+
marginLeft: 8,
291331
marginTop: 4,
292332
marginRight: 8,
293333
marginBottom: 4,
294-
marginLeft: 8
334+
defaultValue: 'n/a'
295335
},
296336
// e.g.
297337
// [{
298338
// id: 'icon_id',
299-
// position: 'left', // 'left', 'middle', 'right'
339+
// position: 'left', // 'left' | 'middle' | 'right'
300340
// marginLeft: 8,
301341
// marginTop: 6,
302342
// marginRight: 0,
@@ -311,14 +351,10 @@ const styles = {
311351
// backgroundColor: 'rgba(33, 150, 243, 0.2)',
312352
// activeBackgroundColor: 'rgba(33, 150, 243, 0.4)',
313353
// type: 'path', // 'path', 'icon_font'
314-
// path: {
354+
// content: {
315355
// style: 'stroke', // 'stroke', 'fill'
316356
// path: 'M6.81029,6.02908L11.7878,1.02746C12.0193,0.79483,12.0193,0.445881,11.7878,0.213247C11.5563,-0.019386,11.209,-0.019386,10.9775,0.213247L6,5.21486L1.02251,0.174475C0.790997,-0.0581583,0.44373,-0.0581583,0.212219,0.174475C-0.0192925,0.407108,-0.0192925,0.756058,0.212219,0.988691L5.18971,6.02908L0.173633,11.0307C-0.0578778,11.2633,-0.0578778,11.6123,0.173633,11.8449C0.289389,11.9612,0.44373,12,0.598071,12C0.752411,12,0.906752,11.9612,1.02251,11.8449L6,6.8433L10.9775,11.8449C11.0932,11.9612,11.2476,12,11.4019,12C11.5563,12,11.7106,11.9612,11.8264,11.8449C12.0579,11.6123,12.0579,11.2633,11.8264,11.0307L6.81029,6.02908Z',
317357
// lineWidth: 1,
318-
// },
319-
// iconFont: {
320-
// content: '\ue900',
321-
// family: 'iconfont'
322358
// }
323359
// }]
324360
features: []
@@ -415,7 +451,32 @@ const styles = {
415451
paddingTop: 4,
416452
paddingBottom: 4,
417453
backgroundColor: '#686D76'
418-
}
454+
},
455+
// e.g.
456+
// [{
457+
// id: 'icon_id',
458+
// position: 'left', // 'left' | 'middle' | 'right'
459+
// marginLeft: 8,
460+
// marginTop: 6,
461+
// marginRight: 0,
462+
// marginBottom: 0,
463+
// paddingLeft: 1,
464+
// paddingTop: 1,
465+
// paddingRight: 1,
466+
// paddingBottom: 1,
467+
// size: 12,
468+
// color: '#76808F',
469+
// activeColor: '#76808F',
470+
// backgroundColor: 'rgba(33, 150, 243, 0.2)',
471+
// activeBackgroundColor: 'rgba(33, 150, 243, 0.4)',
472+
// type: 'path', // 'path', 'icon_font'
473+
// content: {
474+
// style: 'stroke', // 'stroke', 'fill'
475+
// path: 'M6.81029,6.02908L11.7878,1.02746C12.0193,0.79483,12.0193,0.445881,11.7878,0.213247C11.5563,-0.019386,11.209,-0.019386,10.9775,0.213247L6,5.21486L1.02251,0.174475C0.790997,-0.0581583,0.44373,-0.0581583,0.212219,0.174475C-0.0192925,0.407108,-0.0192925,0.756058,0.212219,0.988691L5.18971,6.02908L0.173633,11.0307C-0.0578778,11.2633,-0.0578778,11.6123,0.173633,11.8449C0.289389,11.9612,0.44373,12,0.598071,12C0.752411,12,0.906752,11.9612,1.02251,11.8449L6,6.8433L10.9775,11.8449C11.0932,11.9612,11.2476,12,11.4019,12C11.5563,12,11.7106,11.9612,11.8264,11.8449C12.0579,11.6123,12.0579,11.2633,11.8264,11.0307L6.81029,6.02908Z',
476+
// lineWidth: 1,
477+
// }
478+
// }]
479+
features: []
419480
},
420481
vertical: {
421482
show: true,

docs/en-US/guide/changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# 📠 Change Log
22

3+
## 10.0.0-alpha6
4+
`Under construction`
5+
+ 👉 Chart api `init(ds, options)` , `options.customApi` changed to `options.formatter` , `formatDate` parameter changed to object.
6+
+ 👉 Instance api `setCustomApi` changed to `setFormatter` , `getCustomApi` changed to `getFormatter`.
7+
+ 🆕 Style configuration add `candle.priceMark.last.extendTexts` , `candle.tooltip.title` , `candle.tooltip.legend` , `indicator.tooltip.title` , `indicator.tooltip.legend` and `crosshair.horizontal.features` .
8+
+ 🆕 Instance api add `setDataLoader` , `setSymbol` , `getSymbol` , `setPeriod` , `getPeriod` and `resetData` .
9+
+ 🆕 Instance api `subscribeAction` and `unsubscribeAction` params add `onIndicatorTooltipFeatureClick` and `onCrosshairFeatureClick` .
10+
+ 🗑 Remove `candle.tooltip.defaultValue` in style configuration, replace `candle.tooltip.custom` with `candle.tooltip.legend`, remove `candle.tooltip.text`, remove `indicator.tooltip.showName`, `indicator.tooltip.showParams`, use `indicator.tooltip.title`, remove `indicator.tooltip.defaultValue`, replace with `indicator.tooltip.legend`, remove `indicator.tooltip.text`.
11+
+ 🗑 Remove `setLoadMoreData` , `applyNewData` , `updateData` in instance api, replace with `setDataLoader`, remove `clearData`, `setPrecision` and `getPrecision` .
12+
+ 🐞 Fix the confusion of overlay `onSelected` and `onDeselected` responses.
13+
+ 🐞 Fix the display problem when the style configuration `candle.type` is `ohlc` .
14+
+ 💄 Optimize the default event response of overlay events.
15+
+ 💄 Optimize the x-axis display.
16+
317
## 10.0.0-alpha5
418
`2025-03-09`
519
+ 👉 Style configuration `candle.tooltip.icons` changed to `candle.tooltip.features`, `indicator.tooltip.icons` changed to `indicator.tooltip.features`.

docs/en-US/guide/v9-to-v10.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@ This document will help you upgrade from klinecharts version 9.x to klinecharts
33

44
## Style configuration adjustment
55
+ 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) .
6-
+ Remove `overlay.rectText` .
6+
+ Remove `overlay.rectText`, `candle.tooltip.text`, `indicator.tooltip.text`.
7+
+ Remove `candle.tooltip.defaultValue`, `candle.tooltip.custom`, please use `candle.tooltip.legend` instead.
8+
+ Remove `indicator.tooltip.showName`, `indicator.tooltip.showParams`, please use `indicator.tooltip.title` instead.
9+
+ Remove `indicator.tooltip.defaultValue`, please use `indicator.tooltip.legend` instead.
710
+ `candle.tooltip.icons` changed to `candle.tooltip.features`, `indicator.tooltip.icons` changed to `indicator.tooltip.features`.
811

912
## API adjustment
1013

1114
### Chart API
1215
+ 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.
13-
+ `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` .
16+
+ `init(dcs, options)`, `position` in `options.layout` sub-item changed to `order`, `options.customApi` changed to `options.formatter`, among which `formatDate(dateTimeFormat, timestamp, format, type)` changed to `formatDate({ dateTimeFormat, timestamp, format, type })`, `options.thousandsSeparator` changed to object `{ sign, format }`, `options.decimalFoldThreshold` changed to `options.decimalFold`.
1417

1518
### Instance API
16-
+ Remove `setPriceVolumePrecision(pricePrecision, volumePrecision)`, please use `setPrecision(precision)` instead.
17-
+ Remove `applyMoreData(dataList, more, callback)` , `setLoadDataCallback(cb)` and `loadMore(cb)` , please use `setLoadMoreDataCallback(cb)` instead.
19+
+ Remove `setCustomApi(api)`, please use `setFormatter(formatter)` instead.
20+
+ Remove `getCustomApi(api)`, please use `getFormatter(formatter)` instead.
21+
+ Remove `setPriceVolumePrecision(pricePrecision, volumePrecision)`, please use `setSymbol(symbolInfo)` instead.
22+
+ Remove `applyNewData(dataList, data, callback)`, `applyMoreData(dataList, more, callback)`, `updateData(data, callback)`, `setLoadDataCallback(cb)` and `loadMore(cb)`, please use `setDataLoader(loader)` instead.
23+
+ Remove `clearData()`
1824
+ Remove `getIndicatorByPaneId(paneId, name)`, please use `getIndicators(filter)` instead.
1925
+ Remove `getOverlayById(id)`, please use `getOverlays(filter)` instead.
20-
+ Remove `onTooltipIconClick` in `subscribeAction` and `unsubscribeAction`, use `onCandleTooltipFeatureClick` and `onClick` in indicators instead.
21-
+ `applyNewData(dataList, more, callback)` is changed to `applyNewData(dataList, more)` .
22-
+ `updateData(data, callback)` is changed to `updateData(data)` .
26+
+ Remove `onTooltipIconClick` in `subscribeAction` and `unsubscribeAction`, please use `onCandleTooltipFeatureClick` and `onIndicatorTooltipFeatureClick` in indicators instead.
2327
+ `getBarSpace()` return value changed to object.
2428
+ `createIndicator` return value changed to return indicator id.
2529

docs/guide/changelog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# 📠 更新日志
22

3+
## 10.0.0-alpha6
4+
`开发中`
5+
+ 👉 图表api `init(ds, options)` 中的 `options.customApi` 变更为 `options.formatter``formatDate` 参数变更为对象。
6+
+ 👉 实例api `setCustomApi` 变更为 `setFormatter``getCustomApi` 变更为 `getFormatter`
7+
+ 🆕 样式配置新增 `candle.priceMark.last.extendTexts``candle.tooltip.title``candle.tooltip.legend``indicator.tooltip.title``indicator.tooltip.legend` , 和 `crosshair.horizontal.features`
8+
+ 🆕 实例方法新增 `setDataLoader``setSymbol``getSymbol``setPeriod``getPeriod``resetData`
9+
+ 🆕 实例api的 `subscribeAction``unsubscribeAction` , 入参 `type` 新增 `onIndicatorTooltipFeatureClick``onCrosshairFeatureClick`
10+
+ 🗑 样式配置删除 `candle.tooltip.defaultValue``candle.tooltip.custom` 请替换为 `candle.tooltip.legend` ,删除 `candle.tooltip.text` ,删除 `indicator.tooltip.showName``indicator.tooltip.showParams` ,请用 `indicator.tooltip.title` ,删除 `indicator.tooltip.defaultValue` , 请替换为 `indicator.tooltip.legend` , 删除 `indicator.tooltip.text`
11+
+ 🗑 实例api删除 `setLoadMoreData``applyNewData``updateData` , 请替换为 `setDataLoader` , 删除 `clearData``setPrecision``getPrecision`
12+
+ 🐞 修复覆盖物 `onSelected``onDeselected` 响应错乱问题。
13+
+ 🐞 修复样式配置 `candle.type``ohlc` 时的显示问题。
14+
+ 💄 优化覆盖物事件默认事件响应。
15+
+ 💄 优化x轴显示。
16+
317
## 10.0.0-alpha5
418
`2025-03-09`
519
+ 👉 样式配置 `candle.tooltip.icons` 变更为 `candle.tooltip.features``indicator.tooltip.icons` 变更为 `indicator.tooltip.features`

docs/guide/v9-to-v10.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@
33

44
## 样式配置调整
55
+ 删除 `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)
6-
+ 删除 `overlay.rectText`
6+
+ 删除 `overlay.rectText``candle.tooltip.text``indicator.tooltip.text`
7+
+ 删除 `candle.tooltip.defaultValue``candle.tooltip.custom` 请用 `candle.tooltip.legend` 代替。
8+
+ 删除 `indicator.tooltip.showName``indicator.tooltip.showParams` ,请用 `indicator.tooltip.title` 代替。
9+
+ 删除 `indicator.tooltip.defaultValue` , 请用 `indicator.tooltip.legend` 代替。
710
+ `candle.tooltip.icons` 变更为 `candle.tooltip.features``indicator.tooltip.icons` 变更为 `indicator.tooltip.features`
811

912
## API调整
1013

1114
### 图表API
1215
+ 删除 `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)` 代替。
13-
+ `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`
16+
+ `init(dcs, options)``options.layout` 子项中的 `position` 变更为 `order``options.customApi` 变更为 `options.formatter`, 其中 `formatDate(dateTimeFormat, timestamp, format, type)` 变更为 `formatDate({ dateTimeFormat, timestamp, format, type })``options.thousandsSeparator` 变更为对象 `{ sign, format }``options.decimalFoldThreshold` 变更为 `options.decimalFold`
1417

1518
### 实例API
16-
+ 删除 `setPriceVolumePrecision(pricePrecision, volumePrecision)` ,请使用 `setPrecision(precision)` 代替。
17-
+ 删除 `applyMoreData(dataList, more, callback)``setLoadDataCallback(cb)``loadMore(cb)` ,请使用 `setLoadMoreDataCallback(cb)` 代替。
19+
+ 删除 `setCustomApi(api)` 请使用 `setFormatter(formatter)` 代替。
20+
+ 删除 `getCustomApi(api)` 请使用 `getFormatter(formatter)` 代替。
21+
+ 删除 `setPriceVolumePrecision(pricePrecision, volumePrecision)` ,请使用 `setSymbol(symbolInfo)` 代替。
22+
+ 删除 `applyNewData(dataList, data, callback)``applyMoreData(dataList, more, callback)``updateData(data, callback)` `setLoadDataCallback(cb)``loadMore(cb)` ,请使用 `setDataLoader(loader)` 代替。
23+
+ 删除 `clearData()`
1824
+ 删除 `getIndicatorByPaneId(paneId, name)` ,请使用 `getIndicators(filter)` 代替。
1925
+ 删除 `getOverlayById(id)` ,请使用 `getOverlays(filter)` 代替。
20-
+ 删除 `subscribeAction``unsubscribeAction` 中的 `onTooltipIconClick` ,请使用 `onCandleTooltipFeatureClick` 和指标中的 `onClick` 代替。
21-
+ `applyNewData(dataList, more, callback)` 变更为 `applyNewData(dataList, more)`
22-
+ `updateData(data, callback)` 变更为 `updateData(data)`
26+
+ 删除 `subscribeAction``unsubscribeAction` 中的 `onTooltipIconClick` ,请使用 `onCandleTooltipFeatureClick` 和指标中的 `onIndicatorTooltipFeatureClick` 代替。
2327
+ `getBarSpace()` 返回值变更为对象。
2428
+ `createIndicator` 返回值变更为返回指标id。
2529

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "klinecharts",
3-
"version": "10.0.0-alpha5",
3+
"version": "10.0.0-alpha6",
44
"description": "Lightweight k-line chart built with html5 canvas",
55
"type": "module",
66
"main": "./dist/index.cjs",

0 commit comments

Comments
 (0)