From 195c1478a8ff53234fc22bd1b186320eaaee3ee6 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Fri, 12 Aug 2022 16:41:56 +0800 Subject: [PATCH 01/10] feat(funnel): set prop to flaten the exit piece --- en/option/series/funnel.md | 6 ++++++ zh/option/series/funnel.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index 8275c99c8..a8376848b 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -64,6 +64,12 @@ Orient of funnel,Can be `'vertical'` or `'horizontal'`. Data sorting, which can be whether `'ascending'`, `'descending'`, `'none'`(in data order) or a function, which is the same as `Array.prototype.sort(function (a, b) { ... })`; +## exitShape(string) = 'none' + + + +Funnel exit shape, set it `'rect'` to flatten the top. + ## gap(number) = 0 diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index 039846869..1e696bd2b 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -86,6 +86,12 @@ option = { 数据排序, 可以取 `'ascending'`,`'descending'`,`'none'`(表示按 data 顺序),或者一个函数(即 `Array.prototype.sort(function (a, b) { ... })`)。 +## exitShape(string) = 'none' + + + +漏斗出口形状, 设为 `'rect'` 来展平顶部。 + ## gap(number) = 0 From 536738304f416bd34616a7642f5e07187771ffe8 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Fri, 12 Aug 2022 16:45:57 +0800 Subject: [PATCH 02/10] feat(funnel): add dynamicHegiht prop --- en/option/series/funnel.md | 14 ++++++++++---- zh/option/series/funnel.md | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index a8376848b..9e2148545 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -24,19 +24,19 @@ -The specified minimum value. +The specified minimum value. Invalid if dynamicHeight is `true`. ## max(number) = 100 -The specified maximum value. +The specified maximum value. Invalid if dynamicHeight is `true`. ## minSize(number|string) = '0%' -The mapped width from minimum data value [min](~series-funnel.min). +The mapped width from minimum data value [min](~series-funnel.min). Invalid if dynamicHeight is `true`. It can be absolute pixel and also the percentage of [layout width](~series-funnel.width). If you don't want the graph of minimum value to be a triangle, you can set up this property larger than 0. @@ -44,7 +44,7 @@ It can be absolute pixel and also the percentage of [layout width](~series-funne -The mapped width from maximum data value [max](~series-funnel.max). +The mapped width from maximum data value [max](~series-funnel.max). Invalid if dynamicHeight is `true`. It can be absolute pixel and also the percentage of [layout width](~series-funnel.width). @@ -70,6 +70,12 @@ Data sorting, which can be whether `'ascending'`, `'descending'`, `'none'`(in da Funnel exit shape, set it `'rect'` to flatten the top. +## dynamicHeight(boolean) = 'false' + + + +Set to `true` so that the height of each funnel block in the funnel plot is proportional to the corresponding value in the dataset. + ## gap(number) = 0 diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index 1e696bd2b..cdf02f133 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -46,19 +46,19 @@ option = { -指定的数据最小值。 +指定的数据最小值。dynamicHeight为`true`时无效。 ## max(number) = 100 -指定的数据最大值。 +指定的数据最大值。dynamicHeight为`true`时无效。 ## minSize(number|string) = '0%' -数据最小值 [min](~series-funnel.min) 映射的宽度。 +数据最小值 [min](~series-funnel.min) 映射的宽度。dynamicHeight为`true`时无效。 可以是绝对的像素大小,也可以是相对[布局宽度](~series-funnel.width)的百分比,如果需要最小值的图形并不是尖端三角,可通过设置该属性实现。 @@ -66,7 +66,7 @@ option = { -数据最大值 [max](~series-funnel.max) 映射的宽度。 +数据最大值 [max](~series-funnel.max) 映射的宽度。dynamicHeight为`true`时无效。 可以是绝对的像素大小,也可以是相对[布局宽度](~series-funnel.width)的百分比。 @@ -92,6 +92,12 @@ option = { 漏斗出口形状, 设为 `'rect'` 来展平顶部。 +## dynamicHeight(boolean) = 'false' + + + +设置为`true`使得漏斗图每个漏斗块的高度和数据集对应数值成正比。 + ## gap(number) = 0 From 6d224c2372e357aff10cb8e9ed9b93bdfc2036ab Mon Sep 17 00:00:00 2001 From: gxd3 Date: Fri, 12 Aug 2022 19:36:18 +0800 Subject: [PATCH 03/10] feat(funnel):add exitWidth prop --- en/option/series/funnel.md | 7 +++++++ zh/option/series/funnel.md | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index 9e2148545..b5064b366 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -76,6 +76,13 @@ Funnel exit shape, set it `'rect'` to flatten the top. Set to `true` so that the height of each funnel block in the funnel plot is proportional to the corresponding value in the dataset. +## exitWidth(string) + + + +When dynamicHeight is true, this prop control outlet width is a fraction of the inlet width, and set exitWidth to make the figure more like a funnel shape than a pyramid shape with a sharp bottom. +ExitWidht must be a string in percentage format and cannot exceed 99%. + ## gap(number) = 0 diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index cdf02f133..5d7b7ec79 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -98,6 +98,13 @@ option = { 设置为`true`使得漏斗图每个漏斗块的高度和数据集对应数值成正比。 +## exitWidth(string) + + + +当dynamicHeight为true时,控制出口宽度占入口宽度多少,设置exitWidth可以使图形更接近漏斗形状,而非尖底的金字塔形状。 +exitWidht必须是百分比格式的字符串,而且不能超过99%。 + ## gap(number) = 0 From 1359abf4c0379f695dc955727ddc85a586de1719 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Sun, 14 Aug 2022 20:24:56 +0800 Subject: [PATCH 04/10] feat(funnel):add transform rate between each data --- en/option/series/funnel.md | 9 ++++++++- zh/option/series/funnel.md | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index b5064b366..f2889a969 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -80,9 +80,16 @@ Set to `true` so that the height of each funnel block in the funnel plot is prop -When dynamicHeight is true, this prop control outlet width is a fraction of the inlet width, and set exitWidth to make the figure more like a funnel shape than a pyramid shape with a sharp bottom. +When dynamicHeight is `true`, this prop control outlet width is a fraction of the inlet width, and set exitWidth to make the figure more like a funnel shape than a pyramid shape with a sharp bottom.
+When dynamicHeight is not `true` and showRate is `true`, the outlet is controlled as a trapezoid, that is, the top edge of the outlet block is a fraction of the bottom edge.
ExitWidht must be a string in percentage format and cannot exceed 99%. +## showRate(boolean) + + + +When dynamicHeight is `false`, set to `true` to make the funnel plot show the conversion rate of each adjacent data and the overall conversion rate. + ## gap(number) = 0 diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index 5d7b7ec79..62ec3e14c 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -92,7 +92,7 @@ option = { 漏斗出口形状, 设为 `'rect'` 来展平顶部。 -## dynamicHeight(boolean) = 'false' +## dynamicHeight(boolean) @@ -102,9 +102,16 @@ option = { -当dynamicHeight为true时,控制出口宽度占入口宽度多少,设置exitWidth可以使图形更接近漏斗形状,而非尖底的金字塔形状。 +当dynamicHeight为`true`时,控制出口宽度占入口宽度多少,设置exitWidth可以使图形更接近漏斗形状,而非尖底的金字塔形状。
+当dynamicHeight为不为true并且showRate为`true`时,控制出口为一个梯形,即出口块上底边是下底边多少。
exitWidht必须是百分比格式的字符串,而且不能超过99%。 +## showRate(boolean) + + + +在dynamicHeight为`false`时,设置为`true`使得漏斗图展示每个相邻数据的转化率和总体转化率。 + ## gap(number) = 0 From e671605fd263d42414b8fc6e31bf9cb88d38ecc0 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Tue, 6 Sep 2022 13:49:44 +0800 Subject: [PATCH 05/10] feat(funnel): add attr explains --- en/option/series/funnel.md | 23 ++++++++++++++--------- zh/option/series/funnel.md | 22 +++++++++++++--------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index f2889a969..f34f2bb58 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -64,31 +64,36 @@ Orient of funnel,Can be `'vertical'` or `'horizontal'`. Data sorting, which can be whether `'ascending'`, `'descending'`, `'none'`(in data order) or a function, which is the same as `Array.prototype.sort(function (a, b) { ... })`; -## exitShape(string) = 'none' +## exitWidth(string) - + -Funnel exit shape, set it `'rect'` to flatten the top. +This property is to set the top width of the top funnel block, taking the bottom width of the piece as the base. Invalid when dynamicArea is valid. You can flatten the top by setting it as 100% and you can make top trapezoidal by settting it between 0% +and 99% when showRate is true. ## dynamicHeight(boolean) = 'false' -Set to `true` so that the height of each funnel block in the funnel plot is proportional to the corresponding value in the dataset. +Set to `true` so that each data take funnel height as mapping mode base. -## exitWidth(string) +## thickDegree(string) -When dynamicHeight is `true`, this prop control outlet width is a fraction of the inlet width, and set exitWidth to make the figure more like a funnel shape than a pyramid shape with a sharp bottom.
-When dynamicHeight is not `true` and showRate is `true`, the outlet is controlled as a trapezoid, that is, the top edge of the outlet block is a fraction of the bottom edge.
-ExitWidht must be a string in percentage format and cannot exceed 99%. +This property is control then thick degree of then dynamic height funnel, if you set this prop greater than 0% ,the funnel will thicker than default. ## showRate(boolean) -When dynamicHeight is `false`, set to `true` to make the funnel plot show the conversion rate of each adjacent data and the overall conversion rate. +This property will show rate pieces between each data as mapping mode base, invalid when dynamicHeight or dynamicArea is true. + +## dynamicArea(boolean) + + + +This property will let each data take funnel's area, priority lower than dynamciHeight. ## gap(number) = 0 diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index 62ec3e14c..9051f4b92 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -86,31 +86,35 @@ option = { 数据排序, 可以取 `'ascending'`,`'descending'`,`'none'`(表示按 data 顺序),或者一个函数(即 `Array.prototype.sort(function (a, b) { ... })`)。 -## exitShape(string) = 'none' +## exitWidth(string) - + -漏斗出口形状, 设为 `'rect'` 来展平顶部。 +该属性是设置顶部漏斗块的顶部宽度,以块的底部宽度为底。当 dynamicArea 有效时无效。您可以通过将其设置为 100% 来使顶部变平,当 showRate 为 true 时,您可以通过将其设置在 0% 和 99% 之间来使顶部为梯形。 ## dynamicHeight(boolean) -设置为`true`使得漏斗图每个漏斗块的高度和数据集对应数值成正比。 +设置为true使每个数据采用漏斗高度作为映射模式基准。 -## exitWidth(string) +## thickDegree(string) -当dynamicHeight为`true`时,控制出口宽度占入口宽度多少,设置exitWidth可以使图形更接近漏斗形状,而非尖底的金字塔形状。
-当dynamicHeight为不为true并且showRate为`true`时,控制出口为一个梯形,即出口块上底边是下底边多少。
-exitWidht必须是百分比格式的字符串,而且不能超过99%。 +这个属性是控制动态高度漏斗的粗细度,如果你设置这个属性大于0%,漏斗会比默认的更粗。 ## showRate(boolean) -在dynamicHeight为`false`时,设置为`true`使得漏斗图展示每个相邻数据的转化率和总体转化率。 +此属性将显示每个数据之间的转化率片段,当 dynamicHeight 或 dynamicArea 为 true 时无效。 + +## dynamicArea(boolean) + + + +这个属性会让每个数据以漏斗的区域作为映射基准,优先级低于 dynamciHeight。 ## gap(number) = 0 From 92efefb38f13cbecb3f3cc5575bdbea5100ce383 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Wed, 21 Sep 2022 09:30:02 +0800 Subject: [PATCH 06/10] feat(funnel): supplt doc --- en/option/series/funnel.md | 12 ++++++------ zh/option/series/funnel.md | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index f34f2bb58..bccdf8e15 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -24,19 +24,19 @@ -The specified minimum value. Invalid if dynamicHeight is `true`. +The specified minimum value. Invalid if `dynamicHeight` is `true`. ## max(number) = 100 -The specified maximum value. Invalid if dynamicHeight is `true`. +The specified maximum value. Invalid if `dynamicHeight` is `true`. ## minSize(number|string) = '0%' -The mapped width from minimum data value [min](~series-funnel.min). Invalid if dynamicHeight is `true`. +The mapped width from minimum data value [min](~series-funnel.min). Invalid if `dynamicHeight` is `true`. It can be absolute pixel and also the percentage of [layout width](~series-funnel.width). If you don't want the graph of minimum value to be a triangle, you can set up this property larger than 0. @@ -44,7 +44,7 @@ It can be absolute pixel and also the percentage of [layout width](~series-funne -The mapped width from maximum data value [max](~series-funnel.max). Invalid if dynamicHeight is `true`. +The mapped width from maximum data value [max](~series-funnel.max). Invalid if `dynamicHeight` is `true`. It can be absolute pixel and also the percentage of [layout width](~series-funnel.width). @@ -81,13 +81,13 @@ Set to `true` so that each data take funnel height as mapping mode base. -This property is control then thick degree of then dynamic height funnel, if you set this prop greater than 0% ,the funnel will thicker than default. +This property is control the thick degree of then dynamic height funnel, if you set this prop greater than 0% ,the funnel will thicker than default. ## showRate(boolean) -This property will show rate pieces between each data as mapping mode base, invalid when dynamicHeight or dynamicArea is true. +In the default mapping mode, this property will show rate pieces between each data as mapping mode base. invalid when dynamicHeight or dynamicArea is true.(The other two modes are not currently supported due to Label limitations.) ## dynamicArea(boolean) diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index 9051f4b92..9d9e79053 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -90,7 +90,7 @@ option = { -该属性是设置顶部漏斗块的顶部宽度,以块的底部宽度为底。当 dynamicArea 有效时无效。您可以通过将其设置为 100% 来使顶部变平,当 showRate 为 true 时,您可以通过将其设置在 0% 和 99% 之间来使顶部为梯形。 +该属性是设置顶部漏斗的出口宽度,也就是最后一个漏斗块的上底边长度,其以自身的下底边为基准取百分比。当 dynamicArea 有效时无效。您可以通过将其设置为 100% 来展平出口。当 showRate 为 true 时,您可以通过将其设置在 0% 和 99% 之间来使顶部为梯形。 ## dynamicHeight(boolean) @@ -102,19 +102,19 @@ option = { -这个属性是控制动态高度漏斗的粗细度,如果你设置这个属性大于0%,漏斗会比默认的更粗。 +这个属性是控制动态高度下漏斗的粗细度,如果你设置这个属性大于0%,漏斗会比默认的更粗(钝),或者说没原来的那么尖。 ## showRate(boolean) -此属性将显示每个数据之间的转化率片段,当 dynamicHeight 或 dynamicArea 为 true 时无效。 +在默认的映射模式下,此属性将显示每个数据之间的转化率块,当 dynamicHeight 或 dynamicArea 为 true 时无效。(由于label限制,其他两种模式暂时不支持) ## dynamicArea(boolean) -这个属性会让每个数据以漏斗的区域作为映射基准,优先级低于 dynamciHeight。 +这个属性会让每个数据以漏斗的面积作为映射基准,优先级低于 dynamciHeight。 ## gap(number) = 0 From 6f9d7ad94176f4f57219eb22ca37c7a10dd6d917 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Fri, 21 Oct 2022 12:37:46 +0800 Subject: [PATCH 07/10] feat(funnel): use formatter to set funnel rate label --- en/option/series/funnel.md | 51 ++++++++++++++++++++++++++++++++------ zh/option/series/funnel.md | 51 ++++++++++++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 16 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index bccdf8e15..ad0bd8195 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -36,7 +36,7 @@ The specified maximum value. Invalid if `dynamicHeight` is `true`. -The mapped width from minimum data value [min](~series-funnel.min). Invalid if `dynamicHeight` is `true`. +The mapped width from minimum data value [min](~series-funnel.min). It can be absolute pixel and also the percentage of [layout width](~series-funnel.width). If you don't want the graph of minimum value to be a triangle, you can set up this property larger than 0. @@ -44,7 +44,7 @@ It can be absolute pixel and also the percentage of [layout width](~series-funne -The mapped width from maximum data value [max](~series-funnel.max). Invalid if `dynamicHeight` is `true`. +The mapped width from maximum data value [max](~series-funnel.max). It can be absolute pixel and also the percentage of [layout width](~series-funnel.width). @@ -77,12 +77,6 @@ and 99% when showRate is true. Set to `true` so that each data take funnel height as mapping mode base. -## thickDegree(string) - - - -This property is control the thick degree of then dynamic height funnel, if you set this prop greater than 0% ,the funnel will thicker than default. - ## showRate(boolean) @@ -121,6 +115,47 @@ Horizontal align. Defaults to align center. Can be 'left', 'right', 'center'. formatter = true ) }} +## rateLabel(Object) + +{{ use: partial-label-desc( + name = "funnel rate" +) }} + +### formatter(string|function) + +Data rate label formatter, which supports what the ```label.formatter``` supported too. + +_String template_ + +Append model variation includes: + +- ```{e}```: the name of previous data for conversion rate. +- ```{f}```: the name of next data for conversion rate. +- ```{g}```: the value of a conversion rate. + +_Callback function_ + +Callback function is in form of ```label.formatter``` too. + +And params append following properties. + +```ts + preName: string, + // the name of previous data for conversion rate + nextName: string, + // the name of next data for conversion rate + rate: string, + // percentage of converison rate between each data + isLastPiece: boolean + // is current data the last one, if last one, rate will be the overall rate. +``` + +{{ use: partial-funnel-label( + prefix = "##", + position = false, + formatter = false +) }} + ## labelLine(Object) The visual guide line style of label. When [label position](~series-funnel.label.position) is set as `'left'`or`'right'`, the visual guide line will show. diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index 9d9e79053..1f839f643 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -52,13 +52,13 @@ option = { -指定的数据最大值。dynamicHeight为`true`时无效。 +指定的数据最大值。 ## minSize(number|string) = '0%' -数据最小值 [min](~series-funnel.min) 映射的宽度。dynamicHeight为`true`时无效。 +数据最小值 [min](~series-funnel.min) 映射的宽度。 可以是绝对的像素大小,也可以是相对[布局宽度](~series-funnel.width)的百分比,如果需要最小值的图形并不是尖端三角,可通过设置该属性实现。 @@ -98,12 +98,6 @@ option = { 设置为true使每个数据采用漏斗高度作为映射模式基准。 -## thickDegree(string) - - - -这个属性是控制动态高度下漏斗的粗细度,如果你设置这个属性大于0%,漏斗会比默认的更粗(钝),或者说没原来的那么尖。 - ## showRate(boolean) @@ -142,6 +136,47 @@ option = { formatter = true ) }} +## rateLabel(Object) + +{{ use: partial-label-desc( + name = "funnel rate" +) }} + +### formatter(string|function) + +漏斗数据转化率标签, 支持 ```label.formatter``` 所支持的一切,并且添加了如下特性. + +_String template_ + +新添加的模版都有: + +- ```{e}```: 当前转化率前一个数据的名称. +- ```{f}```: 当前转化率后一个数据的名称. +- ```{g}```: 当前转化率. + +_Callback function_ + +转化率回到和 ```label.formatter``` 的形式一样. + +并且params在```label.formatter```的基础上添加了如下属性. + +```ts + preName: string, + // 当前转化率前一个数据的名称 + nextName: string, + // 当前转化率后一个数据的名称 + rate: string, + // 当前转化率 + isLastPiece: boolean + // 当前数据是否是最后一个数据,如果是最后一个,转化率为整体转化率 +``` + +{{ use: partial-funnel-label( + prefix = "##", + position = false, + formatter = false +) }} + ## labelLine(Object) 标签的视觉引导线样式,在 [label 位置](~series-funnel.label.position) 设置为`'left'`或者`'right'`的时候会显示视觉引导线。 From 308121b8dec5c7a17d54299f44d1bc8007ff3cf2 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Tue, 25 Oct 2022 19:54:06 +0800 Subject: [PATCH 08/10] feat(funnel): prefect the api of rate label formatter --- en/option/series/funnel.md | 16 +++++++++++++--- zh/option/series/funnel.md | 35 ++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index ad0bd8195..5510871a9 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -129,9 +129,11 @@ _String template_ Append model variation includes: -- ```{e}```: the name of previous data for conversion rate. -- ```{f}```: the name of next data for conversion rate. -- ```{g}```: the value of a conversion rate. +- ```{a}```: the value of a conversion rate. +- ```{b}```: the name of previous data for conversion rate. +- ```{c}```: the name of next data for conversion rate. +- ```{e}```: the index of previous data for conversion rate. +- ```{f}```: the index of previous data for conversion rate. _Callback function_ @@ -144,6 +146,10 @@ And params append following properties. // the name of previous data for conversion rate nextName: string, // the name of next data for conversion rate + preIndex: number, + // the index of previous data for conversion rate + nextName: number, + // the index of next data for conversion rate rate: string, // percentage of converison rate between each data isLastPiece: boolean @@ -156,6 +162,10 @@ And params append following properties. formatter = false ) }} +## overallRateLabel(Object) + +the config of overallRateLabel is same as rateLabel, the function of this property is to set the overall conversion rate display. + ## labelLine(Object) The visual guide line style of label. When [label position](~series-funnel.label.position) is set as `'left'`or`'right'`, the visual guide line will show. diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index 1f839f643..e19784008 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -144,31 +144,39 @@ option = { ### formatter(string|function) -漏斗数据转化率标签, 支持 ```label.formatter``` 所支持的一切,并且添加了如下特性. - -_String template_ +_字符串模版_ 新添加的模版都有: -- ```{e}```: 当前转化率前一个数据的名称. -- ```{f}```: 当前转化率后一个数据的名称. -- ```{g}```: 当前转化率. +- ```{a}```: 当前转化率. +- ```{b}```: 当前转化率前一个数据的名称. +- ```{c}```: 当前转化率后一个数据的名称. +- ```{d}```: 当前转化率前一个数据的索引. +- ```{e}```: 当前转化率后一个数据的索引. + +_回调函数_ -_Callback function_ +回调函数格式: -转化率回到和 ```label.formatter``` 的形式一样. +(params: Object|Array) => string -并且params在```label.formatter```的基础上添加了如下属性. +参数 params 是 formatter 需要的单个数据集。格式如下: ```ts +{ + rate: string, + // 当前转化率 preName: string, // 当前转化率前一个数据的名称 nextName: string, // 当前转化率后一个数据的名称 - rate: string, - // 当前转化率 + preIndex: number, + // 当前转化率前一个数据的索引 + nextIndex: number, + // 当前转化率后一个数据的索引 isLastPiece: boolean // 当前数据是否是最后一个数据,如果是最后一个,转化率为整体转化率 +} ``` {{ use: partial-funnel-label( @@ -177,6 +185,11 @@ _Callback function_ formatter = false ) }} + +## overallRateLabel(Object) + +这个属性的配置和rateLabel的配置一致, 这个属性的功能是设置整体转化率。 + ## labelLine(Object) 标签的视觉引导线样式,在 [label 位置](~series-funnel.label.position) 设置为`'left'`或者`'right'`的时候会显示视觉引导线。 From 6cdff619b25de37f9e6b703d0b532ac655b86cd7 Mon Sep 17 00:00:00 2001 From: gxd3 Date: Fri, 28 Oct 2022 09:17:03 +0800 Subject: [PATCH 09/10] feat(funnel): del tpl from rate label formatter --- en/option/series/funnel.md | 14 +------------- zh/option/series/funnel.md | 10 ---------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index 5510871a9..a52acc74d 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -121,19 +121,7 @@ Horizontal align. Defaults to align center. Can be 'left', 'right', 'center'. name = "funnel rate" ) }} -### formatter(string|function) - -Data rate label formatter, which supports what the ```label.formatter``` supported too. - -_String template_ - -Append model variation includes: - -- ```{a}```: the value of a conversion rate. -- ```{b}```: the name of previous data for conversion rate. -- ```{c}```: the name of next data for conversion rate. -- ```{e}```: the index of previous data for conversion rate. -- ```{f}```: the index of previous data for conversion rate. +### formatter(function) _Callback function_ diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index e19784008..d43b8ee7a 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -144,16 +144,6 @@ option = { ### formatter(string|function) -_字符串模版_ - -新添加的模版都有: - -- ```{a}```: 当前转化率. -- ```{b}```: 当前转化率前一个数据的名称. -- ```{c}```: 当前转化率后一个数据的名称. -- ```{d}```: 当前转化率前一个数据的索引. -- ```{e}```: 当前转化率后一个数据的索引. - _回调函数_ 回调函数格式: From 84158a0c46213f3c5925eeb7c1981b050962a58a Mon Sep 17 00:00:00 2001 From: gxd3 Date: Mon, 31 Oct 2022 09:48:17 +0800 Subject: [PATCH 10/10] feat(funnel) add precision to funnl conversion rate --- en/option/series/funnel.md | 20 +++++++++++++------- zh/option/series/funnel.md | 12 ++++++++---- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/en/option/series/funnel.md b/en/option/series/funnel.md index a52acc74d..90fd3cb95 100644 --- a/en/option/series/funnel.md +++ b/en/option/series/funnel.md @@ -121,27 +121,33 @@ Horizontal align. Defaults to align center. Can be 'left', 'right', 'center'. name = "funnel rate" ) }} +### precision + +The precision of the conversion rate. The default value is 2. + ### formatter(function) _Callback function_ -Callback function is in form of ```label.formatter``` too. +Callback function is in form of: + +```js +(params: Object|Array) => string +``` -And params append following properties. +where params is the single dataset needed by formatter, which is formed as: ```ts preName: string, // the name of previous data for conversion rate nextName: string, // the name of next data for conversion rate - preIndex: number, + preDataIndex: number, // the index of previous data for conversion rate - nextName: number, + nextDataIndex: number, // the index of next data for conversion rate rate: string, // percentage of converison rate between each data - isLastPiece: boolean - // is current data the last one, if last one, rate will be the overall rate. ``` {{ use: partial-funnel-label( @@ -152,7 +158,7 @@ And params append following properties. ## overallRateLabel(Object) -the config of overallRateLabel is same as rateLabel, the function of this property is to set the overall conversion rate display. +The config of overallRateLabel is same as rateLabel, the function of this property is to set the overall conversion rate display. ## labelLine(Object) diff --git a/zh/option/series/funnel.md b/zh/option/series/funnel.md index d43b8ee7a..816a65c22 100644 --- a/zh/option/series/funnel.md +++ b/zh/option/series/funnel.md @@ -142,13 +142,19 @@ option = { name = "funnel rate" ) }} +### precision + +漏斗数据转化率的精度.默认值是2. + ### formatter(string|function) _回调函数_ 回调函数格式: +```js (params: Object|Array) => string +``` 参数 params 是 formatter 需要的单个数据集。格式如下: @@ -160,12 +166,10 @@ _回调函数_ // 当前转化率前一个数据的名称 nextName: string, // 当前转化率后一个数据的名称 - preIndex: number, + preDataIndex: number, // 当前转化率前一个数据的索引 - nextIndex: number, + nextDataIndex: number, // 当前转化率后一个数据的索引 - isLastPiece: boolean - // 当前数据是否是最后一个数据,如果是最后一个,转化率为整体转化率 } ```