Skip to content

Commit

Permalink
add doc for apache/echarts#11843
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilia committed Feb 24, 2020
1 parent c133e26 commit 7760524
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
21 changes: 20 additions & 1 deletion en/option/partial/mark-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ Positions of labels can be:
+ `'start'` starting point of the line.
+ `'middle'` middle point of the line.
+ `'end'` ending point of the line.

Since version 4.7.0, more label positions are supported: `'start'`, `'middle'`, `'end'`, `'insideStartTop'`, `'insideStartBottom'`, `'insideMiddleTop'`, `'insideMiddleBottom'`, `'insideEndTop'`, `'insideEndBottom'`.

`'insideMiddleBottom'` is the same as `'middle'`. Position is as the following chart.

The distance between labels and mark lines can be set with [label.distance](~series-${seriesType}.markLine.label.distance).

~[800x500](${galleryViewPath}bar-markline&reset=1&edit=1)

#${prefix} distance(number|Array)
The distance between labels and mark lines. If it's an array, then the first element is the horizontal distance, and the second element is the vertical distance. If it's a number, then the horizontal and vertical disntances are the same.

#${prefix} formatter(string|Function)
{{ use: partial-1d-data-label-formatter }}

Expand Down Expand Up @@ -201,7 +213,14 @@ Label of this data item, which will be merged with `label` of starting point and
{{ use: mark-line-label(
prefix='#'+${prefix}
) }}
##${prefix} emphasis(Object)

#${prefix} emphasis(Object)
##${prefix} lineStyle(Object)
{{ use: partial-line-style(
prefix="##"+${prefix},
hasCurveness=true
) }}
##${prefix} label(Object)
{{ use: mark-line-label(
prefix='##'+${prefix}
) }}
15 changes: 14 additions & 1 deletion zh/option/partial/mark-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,24 @@ data: [
{{ target: mark-line-label }}
#${prefix} show(boolean) = ${defaultShowLabel|default(true)}
是否显示标签。

#${prefix} position(string) = 'end'
标签位置,可选:
+ `'start'` 线的起始点。
+ `'middle'` 线的中点。
+ `'end'` 线的结束点。
+ `'end'` 线的结束点。

4.7.0 版本起,支持更多标签位置:`'start'`, `'middle'`, `'end'`, `'insideStartTop'`, `'insideStartBottom'`, `'insideMiddleTop'`, `'insideMiddleBottom'`, `'insideEndTop'`, `'insideEndBottom'`

其中,`'insideMiddleBottom'` 等同于 `'middle'`。具体位置参见下图。

文字与线的间距可以通过 [label.distance](~series-${seriesType}.markLine.label.distance) 调整。

~[800x500](${galleryViewPath}bar-markline&reset=1&edit=1)

#${prefix} distance(number|Array)
标签与线之间的间距。如果是数组,第一项为横向间距,第二项为纵向间距。如果是数字,则表示横向纵向使用相同的间距。

#${prefix} formatter(string|Function)
{{ use: partial-1d-data-label-formatter }}

Expand Down

0 comments on commit 7760524

Please sign in to comment.