Skip to content

Commit 8f1ccf4

Browse files
committed
refine doc for stack and extract stack doc part (fix #493)
1 parent bffe9f2 commit 8f1ccf4

10 files changed

Lines changed: 188 additions & 173 deletions

File tree

en/option-gl/partial/stack.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
{{ target: partial-stack }}
3+
4+
## stack(string)
5+
6+
Name of the stack group. Series with the same `stack` name on the **same category axis** will be stacked on top of each other. See [stackStrategy](~series-${componentNameInLink}.stackStrategy) for customizing how values are stacked.
7+
8+
**Notice:** Stacking **only supports the stacked axis being of type** `'value'` or `'log'`. Axes of type `'time'` and `'category'` are **not supported** as the stacked axis.
9+
10+
{{ if: ${componentNameInLink} === 'line' }}
11+
You can view the effect of the example below by switching stacks in the [toolbox](~toolbox) in the top-right corner.
12+
13+
~[600x400](${galleryViewPath}doc-example/line-stack-tiled&edit=1&reset=1)
14+
{{ /if }}
15+
16+
## stackStrategy(string) = 'samesign'
17+
18+
{{ use: partial-version(
19+
isECharts = true,
20+
version = '5.3.3'
21+
) }}
22+
23+
Strategy for stacking values, only effective when [stack](~series-${componentNameInLink}.stack) is set. Optional values:
24+
25+
+ `'samesign'` Only stack values if the value to be stacked has the **same sign** as the currently cumulated stacked value. **(Default)**
26+
+ `'all'` Stack all values regardless of positive or negative.
27+
+ `'positive'` Only stack positive values.
28+
+ `'negative'` Only stack negative values.
29+
30+
## stackOrder(string) = 'seriesAsc'
31+
32+
{{ use: partial-version(
33+
isECharts = true,
34+
version = '6.0.0'
35+
) }}
36+
37+
Stack order. Optional values:
38+
39+
+ `'seriesAsc'` Stack in series order. **(Default)**
40+
+ `'seriesDesc'` Stack in reversed series order.
41+
42+
**Notice:**
43+
44+
+ `stackOrder` should be defined for all series with the same `stack` name. If `stackOrder` is defined for only some of the series, the stack order may change unexpectedly when certain series are hidden (e.g., through legend toggle).

en/option-gl/series/bar3D.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,10 @@ Below are the differences between beveling and no beveling.
3636

3737
The smoothness of the bevel, the larger the value, the smoother.
3838

39-
## stack(string)
40-
41-
Stacking of bar chart. On the same category axis, the series with the same `stack` name would be put on top of each other. Note that the data items that need to be stack in different series must have the same index in the array.
42-
43-
See also [stackStrategy](~series-bar3D.stackStrategy) on how to customize how values are stacked.
44-
45-
Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported.
46-
47-
## stackStrategy(string) = 'samesign'
48-
49-
{{ use: partial-version(
50-
isECharts = true,
51-
version = '5.3.3'
39+
{{ use: partial-stack(
40+
componentNameInLink = 'bar3D'
5241
) }}
5342

54-
How to stack values if the [stack](~series-bar3D.stack) property has been set. Options:
55-
+ `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value.
56-
+ `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value.
57-
+ `'positive'`: only stack positive values.
58-
+ `'negative'`: only stack negative values.
59-
6043
## minHeight(number) = 0
6144

6245
The minimum width of the bar.

en/option/partial/stack.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
{{ target: partial-stack }}
3+
4+
## stack(string)
5+
6+
Name of the stack group. Series with the same `stack` name on the **same category axis** will be stacked on top of each other. See [stackStrategy](~series-${componentNameInLink}.stackStrategy) for customizing how values are stacked.
7+
8+
**Notice:** Stacking **only supports the stacked axis being of type** `'value'` or `'log'`. Axes of type `'time'` and `'category'` are **not supported** as the stacked axis.
9+
10+
{{ if: ${componentNameInLink} === 'line' }}
11+
You can view the effect of the example below by switching stacks in the [toolbox](~toolbox) in the top-right corner.
12+
13+
~[600x400](${galleryViewPath}doc-example/line-stack-tiled&edit=1&reset=1)
14+
{{ /if }}
15+
16+
## stackStrategy(string) = 'samesign'
17+
18+
{{ use: partial-version(
19+
version = '5.3.3'
20+
) }}
21+
22+
Strategy for stacking values, only effective when [stack](~series-${componentNameInLink}.stack) is set. Optional values:
23+
24+
+ `'samesign'` Only stack values if the value to be stacked has the **same sign** as the currently cumulated stacked value. **(Default)**
25+
+ `'all'` Stack all values regardless of positive or negative.
26+
+ `'positive'` Only stack positive values.
27+
+ `'negative'` Only stack negative values.
28+
29+
## stackOrder(string) = 'seriesAsc'
30+
31+
{{ use: partial-version(
32+
version = '6.0.0'
33+
) }}
34+
35+
Stack order. Optional values:
36+
37+
+ `'seriesAsc'` Stack in series order. **(Default)**
38+
+ `'seriesDesc'` Stack in reversed series order.
39+
40+
**Notice:**
41+
42+
+ `stackOrder` should be defined for all series with the same `stack` name. If `stackOrder` is defined for only some of the series, the stack order may change unexpectedly when certain series are hidden (e.g., through legend toggle).
43+
44+
+ Not supported in `polar` coordinate system.

en/option/series/bar.md

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -135,41 +135,10 @@ Configurations of select state. Available when [selectedMode](~series-bar.select
135135
version = '5.0.0'
136136
) }}
137137

138-
## stack(string) = null
139-
140-
Name of stack. On the same category axis, the series with the same `stack` name would be put on top of each other.
141-
142-
See also [stackStrategy](~series-bar.stackStrategy) on how to customize how values are stacked.
143-
144-
Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported.
145-
146-
## stackStrategy(string) = 'samesign'
147-
148-
{{ use: partial-version(
149-
version = '5.3.3'
138+
{{ use: partial-stack(
139+
componentNameInLink = 'bar'
150140
) }}
151141

152-
How to stack values if the [stack](~series-bar.stack) property has been set. Options:
153-
154-
+ `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value.
155-
+ `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value.
156-
+ `'positive'`: only stack positive values.
157-
+ `'negative'`: only stack negative values.
158-
159-
## stackOrder(string) = 'seriesAsc'
160-
161-
{{ use: partial-version(
162-
version = '6.0.0'
163-
) }}
164-
165-
Stack order. Optional values:
166-
+ `'seriesAsc'` (default, stack in series order)
167-
+ `'seriesDesc'` (reverse stack order)
168-
169-
**Note:** `stackOrder` should be defined for all series with the same `stack` name. If `stackOrder` is defined for only some of the series, the stack order may change unexpectedly when certain series are hidden (e.g., through legend toggle).
170-
171-
Not supported in polar coordinate system.
172-
173142
## sampling(string)
174143

175144
The downsampling strategy used when the data size is much larger than pixel size. It will improve the performance when turned on. Defaults to be turned off, indicating that all the data points will be drawn.

en/option/series/line.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -57,45 +57,10 @@ Only work when main axis is `'category'` axis (`axis.type` is `'category'`). Opt
5757

5858
{{ use: partial-legend-hover-link() }}
5959

60-
## stack(string) = null
61-
62-
If stack the value. On the same category axis, the series with the same `stack` name would be put on top of each other.
63-
64-
See also [stackStrategy](~series-line.stackStrategy) on how to customize how values are stacked.
65-
66-
Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported.
67-
68-
The effect of the below example could be seen through stack switching of [toolbox](~toolbox) on the top right corner:
69-
70-
~[600x400](${galleryViewPath}doc-example/line-stack-tiled&edit=1&reset=1)
71-
72-
## stackStrategy(string) = 'samesign'
73-
74-
{{ use: partial-version(
75-
version = '5.3.3'
60+
{{ use: partial-stack(
61+
componentNameInLink = 'line'
7662
) }}
7763

78-
How to stack values if the [stack](~series-line.stack) property has been set. Options:
79-
80-
+ `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value.
81-
+ `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value.
82-
+ `'positive'`: only stack positive values.
83-
+ `'negative'`: only stack negative values.
84-
85-
## stackOrder(string) = 'seriesAsc'
86-
87-
{{ use: partial-version(
88-
version = '6.0.0'
89-
) }}
90-
91-
Stack order. Optional values:
92-
+ `'seriesAsc'` (default, stack in series order)
93-
+ `'seriesDesc'` (reverse stack order)
94-
95-
**Note:** `stackOrder` should be defined for all series with the same `stack` name. If `stackOrder` is defined for only some of the series, the stack order may change unexpectedly when certain series are hidden (e.g., through legend toggle).
96-
97-
Not supported in polar coordinate system.
98-
9964
{{ use: partial-cursor() }}
10065

10166
## connectNulls(boolean) = false

zh/option-gl/partial/stack.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
{{ target: partial-stack }}
3+
4+
## stack(string)
5+
6+
堆叠的组名。在**同一个类目轴(category axis)**上,配置了相同 `stack` 组名的系列会互相堆叠。关于数值的堆叠方式,可参见 [stackStrategy](~series-${componentNameInLink}.stackStrategy)
7+
8+
**注意:**堆叠功能只支持被堆叠轴为 `'value'``'log'` 类型,不支持被堆叠轴为 `'time'``'category'` 类型。
9+
10+
{{ if: ${componentNameInLink} === 'line' }}
11+
下面示例可以通过右上角 [toolbox](~toolbox) 中的堆叠切换看效果:
12+
13+
~[600x400](${galleryViewPath}doc-example/line-stack-tiled&edit=1&reset=1)
14+
{{ /if }}
15+
16+
## stackStrategy(string) = 'samesign'
17+
18+
{{ use: partial-version(
19+
isECharts = true,
20+
version = '5.3.3'
21+
) }}
22+
23+
堆叠数值的计算方式,仅在设置了 [stack](~series-${componentNameInLink}.stack) 属性后生效。可选值:
24+
25+
+ `'samesign'` 仅当待堆叠数值与当前累积堆叠值正负符号一致时才堆叠。**(默认)**
26+
+ `'all'` 堆叠所有数值,不区分正负。
27+
+ `'positive'` 只堆叠正值。
28+
+ `'negative'` 只堆叠负值。
29+
30+
## stackOrder(string) = 'seriesAsc'
31+
32+
{{ use: partial-version(
33+
isECharts = true,
34+
version = '6.0.0'
35+
) }}
36+
37+
堆叠顺序。可选值:
38+
39+
+ `'seriesAsc'` 按系列顺序堆叠。**(默认)**
40+
+ `'seriesDesc'` 按系列反向顺序堆叠。
41+
42+
**注意:**
43+
44+
+ `stackOrder` 应该为所有具有相同 `stack` 名称的系列定义。如果只为部分系列定义 `stackOrder`,当某些系列被隐藏(如通过图例切换)时,可能会导致堆叠顺序发生意外变化。

zh/option-gl/series/bar3D.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,10 @@
3434

3535
柱子倒角的光滑/圆润度,数值越大越光滑/圆润。
3636

37-
## stack(string)
38-
39-
柱状图堆叠,相同 `stack` 值的柱状图系列数据会有叠加。注意不同系列需要叠加的数据项在数组中的索引必须是一样的。关于如何定制数值的堆叠方式,参见 [stackStrategy](~series-bar3D.stackStrategy)
40-
41-
注:目前 `stack` 只支持堆叠于 `value``log` 类型的类目轴上,不支持 `time``category` 类型的类目轴。
42-
43-
## stackStrategy(string) = 'samesign'
44-
45-
{{ use: partial-version(
46-
isECharts = true,
47-
version = '5.3.3'
37+
{{ use: partial-stack(
38+
componentNameInLink = 'bar3D'
4839
) }}
4940

50-
堆积数值的策略,前提是[stack](~series-bar3D.stack)属性已被设置。其值可以是:
51-
52-
+ `'samesign'` 只在要堆叠的值与当前累积的堆叠值具有相同的正负符号时才堆叠。
53-
+ `'all'` 堆叠所有的值,不管当前或累积的堆叠值的正负符号是什么。
54-
+ `'positive'` 只堆积正值。
55-
+ `'negative'` 只堆叠负值。
56-
5741
## minHeight(number) = 0
5842

5943
最小柱子高度。

zh/option/partial/stack.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
{{ target: partial-stack }}
3+
4+
## stack(string)
5+
6+
堆叠的组名。在**同一个类目轴(category axis)**上,配置了相同 `stack` 组名的系列会互相堆叠。关于数值的堆叠方式,可参见 [stackStrategy](~series-${componentNameInLink}.stackStrategy)
7+
8+
**注意:**堆叠功能只支持被堆叠轴为 `'value'``'log'` 类型,不支持被堆叠轴为 `'time'``'category'` 类型。
9+
10+
{{ if: ${componentNameInLink} === 'line' }}
11+
下面示例可以通过右上角 [toolbox](~toolbox) 中的堆叠切换看效果:
12+
13+
~[600x400](${galleryViewPath}doc-example/line-stack-tiled&edit=1&reset=1)
14+
{{ /if }}
15+
16+
## stackStrategy(string) = 'samesign'
17+
18+
{{ use: partial-version(
19+
version = '5.3.3'
20+
) }}
21+
22+
堆叠数值的计算方式,仅在设置了 [stack](~series-${componentNameInLink}.stack) 属性后生效。可选值:
23+
24+
+ `'samesign'` 仅当待堆叠数值与当前累积堆叠值正负符号一致时才堆叠。**(默认)**
25+
+ `'all'` 堆叠所有数值,不区分正负。
26+
+ `'positive'` 只堆叠正值。
27+
+ `'negative'` 只堆叠负值。
28+
29+
## stackOrder(string) = 'seriesAsc'
30+
31+
{{ use: partial-version(
32+
version = '6.0.0'
33+
) }}
34+
35+
堆叠顺序。可选值:
36+
37+
+ `'seriesAsc'` 按系列顺序堆叠。**(默认)**
38+
+ `'seriesDesc'` 按系列反向顺序堆叠。
39+
40+
**注意:**
41+
42+
+ `stackOrder` 应该为所有具有相同 `stack` 名称的系列定义。如果只为部分系列定义 `stackOrder`,当某些系列被隐藏(如通过图例切换)时,可能会导致堆叠顺序发生意外变化。
43+
44+
+ 当前不支持极坐标系。

zh/option/series/bar.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -214,39 +214,10 @@ option = {
214214
version = '5.0.0'
215215
) }}
216216

217-
## stack(string) = null
218-
219-
数据堆叠,同个类目轴上系列配置相同的 `stack` 值可以堆叠放置。关于如何定制数值的堆叠方式,参见 [stackStrategy](~series-bar.stackStrategy)
220-
221-
注:目前 `stack` 只支持堆叠于 `'value'``'log'` 类型的类目轴上,不支持 `'time'``'category'` 类型的类目轴。
222-
223-
## stackStrategy(string) = 'samesign'
224-
225-
{{ use: partial-version(
226-
version = '5.3.3'
227-
) }}
228-
229-
堆积数值的策略,前提是[stack](~series-bar.stack)属性已被设置。其值可以是:
230-
231-
+ `'samesign'` 只在要堆叠的值与当前累积的堆叠值具有相同的正负符号时才堆叠。
232-
+ `'all'` 堆叠所有的值,不管当前或累积的堆叠值的正负符号是什么。
233-
+ `'positive'` 只堆积正值。
234-
+ `'negative'` 只堆叠负值。
235-
236-
## stackOrder(string) = 'seriesAsc'
237-
238-
{{ use: partial-version(
239-
version = '6.0.0'
217+
{{ use: partial-stack(
218+
componentNameInLink = 'bar'
240219
) }}
241220

242-
堆叠顺序。可选值:
243-
+ `'seriesAsc'`(默认,系列顺序堆叠)
244-
+ `'seriesDesc'`(反向堆叠)
245-
246-
**注意:** `stackOrder` 应该为所有具有相同 `stack` 名称的系列定义。如果只为部分系列定义 `stackOrder`,当某些系列被隐藏(如通过图例切换)时,可能会导致堆叠顺序发生意外变化。
247-
248-
当前不支持极坐标系。
249-
250221
## sampling(string)
251222

252223
柱状图在数据量远大于像素点时候的降采样策略,开启后可以有效的优化图表的绘制效率,默认关闭,也就是全部绘制不过滤数据点。

0 commit comments

Comments
 (0)