This is an automated email from the ASF dual-hosted git repository.
plainheart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-doc.git
The following commit(s) were added to refs/heads/master by this push:
new 1faf0c27 doc(candlestick): add doc for remap OHLC to OCLH (fix
apache/echarts#21602)
1faf0c27 is described below
commit 1faf0c27efadabe015256be7d086c02ace95bb0a
Author: plainheart <[email protected]>
AuthorDate: Wed May 6 09:12:01 2026 +0800
doc(candlestick): add doc for remap OHLC to OCLH (fix apache/echarts#21602)
---
en/option/series/candlestick.md | 23 ++++++++++++++++++++++-
zh/option/series/candlestick.md | 24 ++++++++++++++++++++++--
2 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/en/option/series/candlestick.md b/en/option/series/candlestick.md
index 0448255e..36f2386b 100644
--- a/en/option/series/candlestick.md
+++ b/en/option/series/candlestick.md
@@ -180,18 +180,39 @@ Every data item (each line in the example above)
represents a box, which contain
[open, close, lowest, highest] (namely: [opening value, closing value, lowest
value, highest value])
```
+That means the default dimension order of `candlestick` is **OCLH**. If your
source data is in the **OHLC** order (`[open, highest, lowest, close]`), you
can explicitly remap dimensions via
[series-candlestick.encode](~series-candlestick.encode). This applies to both
[dataset](~dataset) and [series.data](~series-candlestick.data).
+
+For example, if each item in `series.data` is `[open, high, low, close]`, you
can configure:
+
+```javascript
+series: [{
+ type: 'candlestick',
+ data: [
+ // [date, open, high, low, close]
+ ['2025-05-01', 2320.26, 2362.94, 2287.3, 2320.26],
+ ['2025-05-02', 2300, 2308.38, 2288.26, 2291.3]
+ ],
+ encode: {
+ x: 0,
+ y: [1, 4, 3, 2] // Remap OHLC to OCLH without reordering the source
data array
+ }
+}]
+```
+
### name(string)
Name of data item.
### value(Array)
-Value of data item.
+Value of data item. Default dimension order is **OCLH**.
```javascript
[open, close, lowest, highest] (namely: [opening value, closing value, lowest
value, highest value])
```
+To adjust the default dimension order, see
[series-candlestick.data](~series-candlestick.data) above.
+
{{ use: partial-data-group-id(
prefix = '##'
) }}
diff --git a/zh/option/series/candlestick.md b/zh/option/series/candlestick.md
index f27d5c64..138a1a8f 100644
--- a/zh/option/series/candlestick.md
+++ b/zh/option/series/candlestick.md
@@ -369,19 +369,39 @@ K 线图的选中状态。开启
[selectedMode](~series-candlestick.selectedMode
[open, close, lowest, highest] (即:[开盘值, 收盘值, 最低值, 最高值])
```
+也就是说,`candlestick` 默认维度顺序是 **OCLH**。如果你的原始数据是 **OHLC**(`[open, highest,
lowest, close]`),可以通过 [series.encode](~series-candlestick.encode)
显式指定维度映射来调整。这对 [dataset](~dataset) 和 [series.data](~series-candlestick.data)
两种写法都支持。
+
+例如,OHLC 数据可这样映射:
+
+```javascript
+series: [{
+ type: 'candlestick',
+ data: [
+ // [date, open, high, low, close]
+ ['2025-05-01', 2320.26, 2362.94, 2287.3, 2320.26],
+ ['2025-05-02', 2300, 2308.38, 2288.26, 2291.3]
+ ],
+ encode: {
+ x: 0,
+ y: [1, 4, 3, 2] // 不修改 data,而是通过 encode 将 OHLC 映射到 OCLH
+ }
+}]
+```
+
### name(string)
数据项名称。
### value(Array)
-数据项值。
-
+数据项值。默认维度顺序为 **OCLH**。
```javascript
[open, close, lowest, highest] (即:[开盘值, 收盘值, 最低值, 最高值])
```
+如需调整默认维度顺序,参见上文 [series-candlestick.data](~series-candlestick.data)。
+
{{ use: partial-data-group-id(
prefix = '##'
) }}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]