You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2021/04/21 05:59:26 UTC

[echarts-doc] branch fix-legend-style created (now c1f3eb3)

This is an automated email from the ASF dual-hosted git repository.

ovilia pushed a change to branch fix-legend-style
in repository https://gitbox.apache.org/repos/asf/echarts-doc.git.


      at c1f3eb3  doc: more intuitive legend apache/echarts#14497

This branch includes the following new commits:

     new c1f3eb3  doc: more intuitive legend apache/echarts#14497

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[echarts-doc] 01/01: doc: more intuitive legend apache/echarts#14497

Posted by ov...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ovilia pushed a commit to branch fix-legend-style
in repository https://gitbox.apache.org/repos/asf/echarts-doc.git

commit c1f3eb3b69e23f9561f0c750e3fee458ef7e753f
Author: Ovilia <zw...@gmail.com>
AuthorDate: Wed Apr 21 13:58:26 2021 +0800

    doc: more intuitive legend apache/echarts#14497
---
 zh/option/component/legend.md          | 92 ++++++++++++++++++++++++++++++++++
 zh/option/partial/item-style.md        | 10 ++--
 zh/option/partial/line-border-style.md | 18 +++----
 zh/option/partial/line-style.md        | 10 +++-
 4 files changed, 116 insertions(+), 14 deletions(-)

diff --git a/zh/option/component/legend.md b/zh/option/component/legend.md
index 1af86c1..0f22da7 100644
--- a/zh/option/component/legend.md
+++ b/zh/option/component/legend.md
@@ -179,6 +179,35 @@ const option = {
 
 图例标记的图形高度。
 
+{{ use: partial-legend-style(
+    name = "图例",
+    prefix = "#"
+) }}
+
+### inactiveColor(Color) = '#ccc'
+
+<ExampleUIControlColor default="#ccc" />
+
+图例关闭时线的颜色。
+
+### inactiveWidth(number) = 2
+
+<ExampleUIControlNumber min="0" default="20" step="1" />
+
+图例关闭时线的宽度,不可取 `'inherit'`。
+
+## symbolSize(number|string) = 'auto'
+
+<ExampleUIControlNumber min="0" default="50" step="5" />
+
+图形大小,类型为 `number | 'auto' | 'inherit'`。
+
+如果为 `'auto'`,不同系列类型可能采用不同的大小逻辑,比如柱状图之类的采用圆角矩形作为图例的,会取 `itemWidth` 和 `itemHeight` 作为大小;而折线图会用 80% 的 `itemHeight` 作为图形高度并叠加一条横线,但如果用户自定义了 `icon`,则以 `itemHeight` 作为图形高度,不绘制横线。具体逻辑取决于系列内部实现。
+
+如果为 `'inherit'` 则表示:始终取系列的图形大小。
+
+无论取何值,最终会保证图形大小不超过 `itemWidth` 和 `itemHeight`。
+
 ## symbolKeepAspect(boolean) = true
 
 <ExampleUIControlBoolean />
@@ -213,6 +242,18 @@ formatter: function (name) {
 
 图例关闭时的颜色。
 
+## inactiveBorderColor(Color) = '#ccc'
+
+<ExampleUIControlColor default="#ccc" />
+
+图例关闭时的描边颜色。
+
+## inactiveBorderWidth(Color) = 'auto'
+
+<ExampleUIControlColor default="#ccc" />
+
+图例关闭时的描边粗细。如果为 `'auto'` 表示:如果系列存在描边,则取 2,如果系列不存在描边,则取 0。如果为 `'inherit'` 则表示:始终取系列的描边粗细。
+
 ## selected(Object)
 
 图例选中状态表。
@@ -293,6 +334,11 @@ data: [{
 
 {{ use: partial-icon() }}
 
+{{ use: partial-legend-style(
+    name = "图例项",
+    prefix = "##"
+) }}
+
 ### textStyle(Object)
 
 图例项的文本样式。
@@ -536,3 +582,49 @@ selector: ['all', 'inverse']
 
 选择器按钮与图例组件之间的间隔。
 
+
+
+{{ target: partial-legend-style }}
+
+#${prefix} itemStyle(Object)
+
+${name}的图形样式。其属性的取值为 `'inherit'` 时,表示继承系列中的属性值。
+
+{{ use: partial-item-style(
+    prefix = '#' + ${prefix},
+    defaultColor = 'inherit',
+    defaultBorderColor = 'inherit',
+    defaultBorderWidth = 'auto',
+    defaultBorderWidthDesc = '当其值为 `"auto"` 时,如果系列有 `borderWidth` 取 2,如果系列没有 `borderWidth` 则取 0。当其值为 `"inehrit"` 时,始终取系列的 `borderWidth`。',
+    defaultType = 'inherit',
+    defaultOpacity = 'inherit',
+    defaultShadowBlur = 0,
+    defaultShadowColor = 'null',
+    defaultShadowOffsetX = 0,
+    defaultShadowOffsetY = 0,
+    useDecal = true,
+    defaultDecal = 'inherit',
+    defaultDashOffset = 'inherit',
+    defaultCap = 'inherit',
+    defaultJoin = 'inherit',
+    defaultMiterLimit = 'inherit'
+) }}
+
+#${prefix} lineStyle(Object)
+
+${name}图形中线的样式,用于诸如折线图图例横线的样式设置。其属性的取值为 `'inherit'` 时,表示继承系列中的属性值。
+
+{{ use: partial-line-style(
+    prefix = '#' + ${prefix},
+    defaultWidth = 'auto',
+    defaultColor = 'inherit',
+    defaultOpacity = 'inherit',
+    defaultType = 'inherit',
+    defaultCap = 'inherit',
+    defaultJoin = 'inherit',
+    defaultDashOffset = 'inherit',
+    defaultMiterLimit = 'inherit',
+    defaultShadowBlur = 'inherit',
+    defaultShadowOffsetX = 0,
+    defaultShadowOffsetY = 0
+) }}
diff --git a/zh/option/partial/item-style.md b/zh/option/partial/item-style.md
index d4a1818..50e28f7 100644
--- a/zh/option/partial/item-style.md
+++ b/zh/option/partial/item-style.md
@@ -33,13 +33,17 @@ ${name}图形的描边颜色。支持的颜色格式同 `color`,不支持回
 
 <ExampleUIControlNumber value="${defaultBorderWidth|default(0)}" min="0" step="0.5" />
 
-${name}描边线宽。为 0 时无描边。
+${defaultBorderWidthDesc|default((${name} ? ${name} : "") + "描边线宽。为 0 时无描边。")}
 
 {{ use: partial-line-border-style(
     prefix = ${prefix},
     name = ${name},
     type = 'border',
-    defaultType = ${defaultType}
+    defaultType = ${defaultType},
+    defaultDashOffset = ${defaultDashOffset},
+    defaultCap = ${defaultCap},
+    defaultJoin = ${defaultJoin},
+    defaultMiterLimit = ${defaultMiterLimit}
 ) }}
 
 {{ use: partial-style-shadow-opacity(
@@ -53,7 +57,7 @@ ${name}描边线宽。为 0 时无描边。
 
 {{ if: ${useDecal} }}
 
-#${prefix} decal(Object)
+#${prefix} decal(Object) = ${defaultDecal}
 
 {{ use: partial-decal-desc(
     onlyWithAreaStyle = ${decalOnlyWithAreaStyle}
diff --git a/zh/option/partial/line-border-style.md b/zh/option/partial/line-border-style.md
index 3dbc80e..a656f54 100644
--- a/zh/option/partial/line-border-style.md
+++ b/zh/option/partial/line-border-style.md
@@ -41,11 +41,11 @@ ${name}描边类型。
 
 
 {{ if: ${type} === 'border' }}
-#${prefix} borderDashOffset(number) = 0
+#${prefix} borderDashOffset(number) = ${defaultDashOffset|default(0)}
 {{ elif: ${type} === 'text'  }}
-#${prefix} textBorderDashOffset(number) = 0
+#${prefix} textBorderDashOffset(number) = ${defaultDashOffset|default(0)}
 {{ else }}
-#${prefix} dashOffset(number) = 0
+#${prefix} dashOffset(number) = ${defaultDashOffset|default(0)}
 {{ /if }}
 
 {{ use: partial-version(
@@ -68,9 +68,9 @@ ${name}描边类型。
 {{ if: !${noCap} }}
 
 {{ if: ${type} === 'border' }}
-#${prefix} borderCap(string) = 'butt'
+#${prefix} borderCap(string) = ${defaultCap|default('butt')}
 {{ else }}
-#${prefix} cap(string) = 'butt'
+#${prefix} cap(string) = ${defaultCap|default('butt')}
 {{ /if }}
 
 {{ use: partial-version(
@@ -92,9 +92,9 @@ ${name}描边类型。
 {{ if: !${noJoin} }}
 
 {{ if: ${type} === 'border' }}
-#${prefix} borderJoin(string) = 'bevel'
+#${prefix} borderJoin(string) = ${defaultJoin|default('bevel')}
 {{ else }}
-#${prefix} join(string) = 'bevel'
+#${prefix} join(string) = ${defaultJoin|default('bevel')}
 {{ /if }}
 
 {{ use: partial-version(
@@ -122,9 +122,9 @@ ${name}描边类型。
 {{ if: !${noMiterLimit} }}
 
 {{ if: ${type} === 'border' }}
-#${prefix} borderMiterLimit(number) = 10
+#${prefix} borderMiterLimit(number) = ${defaultMiterLimit|default(10)}
 {{ else }}
-#${prefix} miterLimit(number) = 10
+#${prefix} miterLimit(number) = ${defaultMiterLimit|default(10)}
 {{ /if }}
 
 {{ use: partial-version(
diff --git a/zh/option/partial/line-style.md b/zh/option/partial/line-style.md
index 3e5e2a5..a3fe178 100644
--- a/zh/option/partial/line-style.md
+++ b/zh/option/partial/line-style.md
@@ -26,14 +26,20 @@ ${name}线宽。
 {{ use: partial-line-border-style(
     prefix = ${prefix},
     name = ${name},
-    defaultType = ${defaultType}
+    defaultType = ${defaultType},
+    defaultCap = ${defaultCap},
+    defaultJoin = ${defaultJoin},
+    defaultDashOffset = ${defaultDashOffset},
+    defaultMiterLimit = ${defaultMiterLimit}
 ) }}
 
 {{ use: partial-style-shadow-opacity(
     prefix = ${prefix},
     defaultOpacity = ${defaultOpacity},
     defaultShadowBlur = ${defaultShadowBlur},
-    defaultShadowColor = ${defaultShadowColor}
+    defaultShadowColor = ${defaultShadowColor},
+    defaultShadowOffsetX = ${defaultShadowOffsetX},
+    defaultShadowOffsetY = ${defaultShadowOffsetY}
 ) }}
 
 {{ if: ${hasCurveness} }}

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org