From 64a15472d435c496c01d4477f7d2b680cc85ea87 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Mon, 23 May 2022 13:56:07 +0300 Subject: [PATCH 1/4] feat: add stackStrategy docs --- en/option-gl/series/bar3D.md | 7 +++++++ en/option/series/bar.md | 8 ++++++++ en/option/series/line.md | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/en/option-gl/series/bar3D.md b/en/option-gl/series/bar3D.md index 524eaaf0f..78ad4b5a9 100644 --- a/en/option-gl/series/bar3D.md +++ b/en/option-gl/series/bar3D.md @@ -42,6 +42,13 @@ Stacking of bar chart. On the same category axis, the series with the same `stac Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported. +## stackStrategy(string) = 'samesign' + +How to stack values if a the `stack` property has been defined. Options: ++ `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. ++ `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. ++ `'positive'`: only stack positive values. ++ `'negatve'`: only stack negative values. ## minHeight(number) = 0 diff --git a/en/option/series/bar.md b/en/option/series/bar.md index 1f62d21db..22f0201b1 100644 --- a/en/option/series/bar.md +++ b/en/option/series/bar.md @@ -142,6 +142,14 @@ Name of stack. On the same category axis, the series with the same `stack` name Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported. +## stackStrategy(string) = 'samesign' + +How to stack values if a the `stack` property has been defined. Options: ++ `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. ++ `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. ++ `'positive'`: only stack positive values. ++ `'negatve'`: only stack negative values. + ## sampling(string) The dowmsampling 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. diff --git a/en/option/series/line.md b/en/option/series/line.md index ef80ec97c..3c98cda45 100644 --- a/en/option/series/line.md +++ b/en/option/series/line.md @@ -68,6 +68,14 @@ The effect of the below example could be seen through stack switching of [toolbo {{ use: partial-cursor() }} +## stackStrategy(string) = 'samesign' + +How to stack values if a the `stack` property has been defined. Options: ++ `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. ++ `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. ++ `'positive'`: only stack positive values. ++ `'negatve'`: only stack negative values. + ## connectNulls(boolean) = false From d4d6baa63619caa69b7c70ae19029f3be78cd035 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Sat, 28 May 2022 15:31:26 +0300 Subject: [PATCH 2/4] add version --- en/option-gl/series/bar3D.md | 4 ++++ en/option/series/bar.md | 4 ++++ en/option/series/line.md | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/en/option-gl/series/bar3D.md b/en/option-gl/series/bar3D.md index 78ad4b5a9..7d576847a 100644 --- a/en/option-gl/series/bar3D.md +++ b/en/option-gl/series/bar3D.md @@ -44,6 +44,10 @@ Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` ## stackStrategy(string) = 'samesign' +{{ use: partial-version( +version = '5.3.3' +) }} + How to stack values if a the `stack` property has been defined. Options: + `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. + `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. diff --git a/en/option/series/bar.md b/en/option/series/bar.md index 22f0201b1..2996ae7b5 100644 --- a/en/option/series/bar.md +++ b/en/option/series/bar.md @@ -144,6 +144,10 @@ Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` ## stackStrategy(string) = 'samesign' +{{ use: partial-version( +version = '5.3.3' +) }} + How to stack values if a the `stack` property has been defined. Options: + `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. + `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. diff --git a/en/option/series/line.md b/en/option/series/line.md index 3c98cda45..c07d9b09f 100644 --- a/en/option/series/line.md +++ b/en/option/series/line.md @@ -70,6 +70,10 @@ The effect of the below example could be seen through stack switching of [toolbo ## stackStrategy(string) = 'samesign' +{{ use: partial-version( +version = '5.3.3' +) }} + How to stack values if a the `stack` property has been defined. Options: + `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. + `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. From 91952666da1c6c948e70ee49e8852cda6d63da08 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Sat, 28 May 2022 15:59:18 +0300 Subject: [PATCH 3/4] fix typo and add anchors --- en/option-gl/series/bar3D.md | 4 +++- en/option/series/bar.md | 4 +++- en/option/series/line.md | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/en/option-gl/series/bar3D.md b/en/option-gl/series/bar3D.md index 7d576847a..65f5bc306 100644 --- a/en/option-gl/series/bar3D.md +++ b/en/option-gl/series/bar3D.md @@ -40,6 +40,8 @@ The smoothness of the bevel, the larger the value, the smoother. 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. +See also [stackStrategy](~series-bar3D.stackStrategy) on how to customize how values are stacked. + Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported. ## stackStrategy(string) = 'samesign' @@ -48,7 +50,7 @@ Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` version = '5.3.3' ) }} -How to stack values if a the `stack` property has been defined. Options: +How to stack values if the [stack](~series-bar3D.stack) property has been set. Options: + `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. + `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. + `'positive'`: only stack positive values. diff --git a/en/option/series/bar.md b/en/option/series/bar.md index 2996ae7b5..1460cedbd 100644 --- a/en/option/series/bar.md +++ b/en/option/series/bar.md @@ -140,6 +140,8 @@ Configurations of select state. Available when [selectedMode](~series-bar.select Name of stack. On the same category axis, the series with the same `stack` name would be put on top of each other. +See also [stackStrategy](~series-bar.stackStrategy) on how to customize how values are stacked. + Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported. ## stackStrategy(string) = 'samesign' @@ -148,7 +150,7 @@ Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` version = '5.3.3' ) }} -How to stack values if a the `stack` property has been defined. Options: +How to stack values if the [stack](~series-bar.stack) property has been set. Options: + `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. + `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. + `'positive'`: only stack positive values. diff --git a/en/option/series/line.md b/en/option/series/line.md index c07d9b09f..0721f486b 100644 --- a/en/option/series/line.md +++ b/en/option/series/line.md @@ -60,26 +60,28 @@ Only work when main axis is `'category'` axis (`axis.type` is `'category'`). Opt If stack the value. On the same category axis, the series with the same `stack` name would be put on top of each other. +See also [stackStrategy](~series-line.stackStrategy) on how to customize how values are stacked. + Notice: `stack` only supports stacking on `value` and `log` axis for now. `time` and `category` axis are not supported. The effect of the below example could be seen through stack switching of [toolbox](~toolbox) on the top right corner: ~[600x400](${galleryViewPath}doc-example/line-stack-tiled&edit=1&reset=1) -{{ use: partial-cursor() }} - ## stackStrategy(string) = 'samesign' {{ use: partial-version( version = '5.3.3' ) }} -How to stack values if a the `stack` property has been defined. Options: +How to stack values if the [stack](~series-line.stack) property has been set. Options: + `'samesign'`: only stack values if the value to be stacked has the same sign as the currently cumulated stacked value. + `'all'`: stack all values, irrespective of the signs of the current or cumulative stacked value. + `'positive'`: only stack positive values. + `'negatve'`: only stack negative values. +{{ use: partial-cursor() }} + ## connectNulls(boolean) = false From ecb8f10a8b4b0b3d75c18c36839a05a83777f2db Mon Sep 17 00:00:00 2001 From: pissang Date: Sun, 29 May 2022 17:19:14 +0800 Subject: [PATCH 4/4] add stackStrategy zh doc --- zh/option/series/bar.md | 15 ++++++++++++++- zh/option/series/line.md | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/zh/option/series/bar.md b/zh/option/series/bar.md index d394992e0..4bdb6b659 100644 --- a/zh/option/series/bar.md +++ b/zh/option/series/bar.md @@ -216,10 +216,22 @@ option = { ## stack(string) = null -数据堆叠,同个类目轴上系列配置相同的`stack`值可以堆叠放置。 +数据堆叠,同个类目轴上系列配置相同的`stack`值可以堆叠放置。参见[stackStrategy](~series-line.stackStrategy)关于如何定制数值的堆叠方式。 注:目前`stack`只支持堆叠于 `value` 和 `log` 类型的类目轴上,不支持 `time` 和 `category` 类型的类目轴。 +## stackStrategy(string) = 'samesign' + +{{ use: partial-version( + version = '5.3.3' +) }} + +如果[stack](~series-bar.stack)属性已被设置,如何堆积数值。选项。 ++ `'samesign'` 只在要堆叠的值与当前累积的堆叠值具有相同的符号时才堆叠。 ++ `'all' 堆叠所有的值,不管当前或累积的堆叠值的符号是什么。 ++ `'正' 只堆积正值。 ++ `'negatve' 只堆叠负值。 + ## sampling(string) 柱状图在数据量远大于像素点时候的降采样策略,开启后可以有效的优化图表的绘制效率,默认关闭,也就是全部绘制不过滤数据点。 @@ -500,3 +512,4 @@ option = { prefix = '#' + ${prefix} ) }} {{ /if }} + diff --git a/zh/option/series/line.md b/zh/option/series/line.md index 9d095130a..43d6d0bb9 100644 --- a/zh/option/series/line.md +++ b/zh/option/series/line.md @@ -89,12 +89,26 @@ const option = { 数据堆叠,同个类目轴上系列配置相同的`stack`值后,后一个系列的值会在前一个系列的值上相加。 +参见[stackStrategy](~series-line.stackStrategy)关于如何定制数值的堆叠方式。 + 注:目前`stack`只支持堆叠于 `value` 和 `log` 类型的类目轴上,不支持 `time` 和 `category` 类型的类目轴。 下面示例可以通过右上角 [toolbox](~toolbox) 中的堆叠切换看效果: ~[600x400](${galleryViewPath}doc-example/line-stack-tiled&edit=1&reset=1) +## stackStrategy(string) = 'samesign' + +{{ use: partial-version( + version = '5.3.3' +) }} + +如果[stack](~series-bar.stack)属性已被设置,如何堆积数值。选项。 ++ `'samesign'` 只在要堆叠的值与当前累积的堆叠值具有相同的符号时才堆叠。 ++ `'all' 堆叠所有的值,不管当前或累积的堆叠值的符号是什么。 ++ `'正' 只堆积正值。 ++ `'negatve' 只堆叠负值。 + {{ use: partial-cursor() }} ## connectNulls(boolean) = false