Skip to content

Commit 15fb9f2

Browse files
authored
Merge pull request #512 from apache/dev
Merge dev into master
2 parents 24cf98b + 2683d6a commit 15fb9f2

10 files changed

Lines changed: 317 additions & 0 deletions

File tree

en/option/component/axis-common.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,66 @@ max: function (value) {
949949

950950
`value` is an object, containing the `min` value and `max` value of the data. This function should return the max value of axis, or return `null`/`undefined` to make echarts use the auto calculated max value (`null`/`undefined` return is only supported since `v4.8.0`).
951951

952+
#${prefix} dataMin(number)
953+
954+
<ExampleUIControlNumber />
955+
956+
{{ use: partial-version(
957+
version = '6.1.0'
958+
) }}
959+
960+
Specify the data minimum value to extend the axis range while preserving the nice scale algorithm.
961+
962+
It is available only for value, logarithmic, and time axes, i.e., [type](~${componentType}.type): 'value', 'log', or 'time'.
963+
964+
**How it works:**
965+
966+
`dataMin` works like inserting a virtual data point into your dataset, but this point only participates in axis range calculation and won't be displayed in the chart.
967+
968+
- When `dataMin` is **less than** the actual data minimum: The axis extends to include this value, using a nice scale value no greater than `dataMin` as the axis minimum
969+
- When `dataMin` is **greater than or equal to** the actual data minimum: No effect, the axis is calculated using the original logic
970+
971+
**Use cases:**
972+
973+
- Ensure the axis includes a reference value (like passing line, target value, etc.)
974+
- Reserve visual space for data
975+
976+
**The difference from [min](~${componentType}.min):**
977+
- `min` fixes the axis minimum value and disables the nice scale algorithm
978+
- `dataMin` only affects the axis range while preserving the nice scale algorithm
979+
980+
981+
982+
#${prefix} dataMax(number)
983+
984+
<ExampleUIControlNumber />
985+
986+
{{ use: partial-version(
987+
version = '6.1.0'
988+
) }}
989+
990+
Specify the data maximum value to extend the axis range while preserving the nice scale algorithm.
991+
992+
It is available only for value, logarithmic, and time axes, i.e., [type](~${componentType}.type): 'value', 'log', or 'time'.
993+
994+
**How it works:**
995+
996+
`dataMax` works like inserting a virtual data point into your dataset, but this point only participates in axis range calculation and won't be displayed in the chart.
997+
998+
- When `dataMax` is **greater than** the actual data maximum: The axis extends to include this value, using a nice scale value no less than `dataMax` as the axis maximum
999+
- When `dataMax` is **less than or equal to** the actual data maximum: No effect, the axis is calculated using the original logic
1000+
1001+
**Use cases:**
1002+
1003+
- Ensure the Y-axis includes a target value or ceiling
1004+
- Reserve visual space above the data for better presentation
1005+
- Maintain consistent axis ranges across multiple charts
1006+
1007+
**The difference from [max](~${componentType}.max):**
1008+
- `max` fixes the axis maximum value and disables the nice scale algorithm
1009+
- `dataMax` only affects the axis range while preserving the nice scale algorithm
1010+
1011+
9521012
#${prefix} scale(boolean) = false
9531013

9541014
<ExampleUIControlBoolean />

en/option/component/radar.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ Here is a custom example of radar component.
2929
none = true
3030
) }}
3131

32+
## clockwise(boolean) = false
33+
34+
{{ use: partial-version(version = "6.1.0") }}
35+
36+
<ExampleUIControlBoolean default="false" />
37+
38+
Whether to clockwise layout indicator axis.
39+
3240
## startAngle(number) = 90
3341

3442
The start angle of coordinate, which is the angle of the first indicator axis.

en/option/component/visual-map.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,55 @@ Specify visual mapping should be performed on which series, from which
325325
Can be a id or a list of ids.
326326
All series are used by default.
327327

328+
## seriesTargets(Array)
329+
330+
{{ use: partial-version(version = "6.1.0") }}
331+
332+
Specify multiple series with their corresponding dimension mappings. When `seriesTargets` is configured, `seriesIndex`, `seriesId`, and `dimension` will be ignored.
333+
334+
This option allows a single `visualMap` component to control different dimensions of multiple series simultaneously, which is particularly useful when working with datasets.
335+
336+
Each target object should contain the following properties:
337+
- `seriesIndex` or `seriesId`: Specify the series (choose one)
338+
- `dimension`: Specify the data dimension for that series
339+
340+
Example:
341+
```javascript
342+
option = {
343+
dataset: {
344+
source: [
345+
['product', 'sales', 'price', 'year'],
346+
['A', 100, 20, 2020],
347+
['B', 200, 30, 2021],
348+
['C', 150, 25, 2022]
349+
]
350+
},
351+
visualMap: {
352+
type: 'continuous',
353+
min: 0,
354+
max: 100,
355+
// Configure different series to use different dimensions
356+
seriesTargets: [
357+
{
358+
seriesIndex: 0,
359+
dimension: 1 // First series uses 'sales' dimension
360+
},
361+
{
362+
seriesIndex: 1,
363+
dimension: 2 // Second series uses 'price' dimension
364+
}
365+
],
366+
inRange: {
367+
color: ['#50a3ba', '#eac736', '#d94e5d']
368+
}
369+
},
370+
series: [
371+
{ type: 'bar' },
372+
{ type: 'line' }
373+
]
374+
};
375+
```
376+
328377
## hoverLink(boolean) = true
329378

330379
`hoverLink` enable highlight certain graphical elements of chart when mouse hovers on some place of `visualMap` component that is corresponding to those graphical elements by visual mapping.

en/option/series/pie.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ Label rotation.
531531

532532
+ If `true` or `'radial'`, the labels are rotated radially. (The `'radial'` literal is supported since `v5.2.0`)
533533
+ If `'tangential'`, the labels are rotated tangentially. (Since `v5.2.0`)
534+
+ If `'tangential-noflip'`, the arrangement will be tangential and will not flip. (Since `v6.1.0`)
534535
+ If `number`, the labels are rotated in degrees (-90° - 90°). The negative value represents clockwise.
535536

536537
{{ use: partial-text-style(

en/tutorial/visual-map.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,46 @@ option = {
145145
};
146146
```
147147

148+
Example C (Using `seriesTargets` to map different dimensions for different series):
149+
150+
```javascript
151+
option = {
152+
dataset: {
153+
source: [
154+
['product', 'sales', 'price', 'year'],
155+
['A', 100, 20, 2020],
156+
['B', 200, 30, 2021],
157+
['C', 150, 25, 2022]
158+
]
159+
},
160+
visualMap: [
161+
{
162+
type: 'continuous',
163+
min: 0,
164+
max: 100,
165+
// seriesTargets allows specifying different mapping dimensions for different series
166+
// When seriesTargets is configured, dimension, seriesIndex, and seriesId are ignored
167+
seriesTargets: [
168+
{
169+
seriesIndex: 0,
170+
dimension: 1 // First series maps to 'sales' dimension
171+
},
172+
{
173+
seriesIndex: 1,
174+
dimension: 2 // Second series maps to 'price' dimension
175+
}
176+
],
177+
inRange: {
178+
color: ['#50a3ba', '#eac736', '#d94e5d']
179+
}
180+
},
181+
...
182+
],
183+
series: [
184+
{ type: 'bar' },
185+
{ type: 'line' }
186+
]
187+
};
188+
```
189+
148190
For more information, please refer to [visualMap.inRange](option.html#visualMap.inRange) and [visualMap.outOfRange](option.html#visualMap.outOfRange).

zh/option/component/axis-common.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,64 @@ max: function (value) {
947947

948948
其中 `value` 是一个包含 `min``max` 的对象,分别表示数据的最大最小值,这个函数可返回坐标轴的最大值,也可返回 `null`/`undefined` 来表示“自动计算最大值”(返回 `null`/`undefined``v4.8.0` 开始支持)。
949949

950+
#${prefix} dataMin(number)
951+
952+
<ExampleUIControlNumber />
953+
954+
{{ use: partial-version(
955+
version = '6.1.0'
956+
) }}
957+
958+
指定数据最小值,用于扩展坐标轴范围同时保持自动刻度优化。
959+
960+
只在数值轴、对数轴、时间轴中([type](~${componentType}.type): 'value'、'log' 或 'time')有效。
961+
962+
**工作原理:**
963+
964+
`dataMin` 的效果好似在数据中插入了一个虚拟的数据点,但这个点只参与坐标轴范围的计算,不会实际显示在图表中。
965+
966+
-`dataMin` **小于**实际数据最小值时:坐标轴会扩展以包含这个值,使用一个不大于 `dataMin` 的整齐刻度值作为坐标轴最小值
967+
-`dataMin` **大于等于**实际数据最小值时:不产生任何影响,按原有逻辑计算
968+
969+
**适用场景:**
970+
971+
- 确保坐标轴包含某个参考值(如及格线、目标值等)
972+
- 需要为数据留出一定的视觉空间
973+
974+
**[min](~${componentType}.min) 的区别:**
975+
- `min` 会固定坐标轴最小值,禁用自动刻度优化
976+
- `dataMin` 只影响坐标轴范围,仍保持自动刻度优化
977+
978+
#${prefix} dataMax(number)
979+
980+
<ExampleUIControlNumber />
981+
982+
{{ use: partial-version(
983+
version = '6.1.0'
984+
) }}
985+
986+
指定数据最大值,用于扩展坐标轴范围同时保持自动刻度优化。
987+
988+
只在数值轴、对数轴、时间轴中([type](~${componentType}.type): 'value'、'log' 或 'time')有效。
989+
990+
**工作原理:**
991+
992+
`dataMax` 的效果好似在数据中插入了一个虚拟的数据点,但这个点只参与坐标轴范围的计算,不会实际显示在图表中。
993+
994+
-`dataMax` **大于**实际数据最大值时:坐标轴会扩展以包含这个值,使用一个不小于 `dataMax` 的整齐刻度值作为坐标轴最大值
995+
-`dataMax` **小于等于**实际数据最大值时:不产生任何影响,按原有逻辑计算
996+
997+
**适用场景:**
998+
999+
- 确保坐标轴包含目标值或上限值
1000+
- 为数据预留视觉空间,使图表更美观
1001+
- 使多个相似的图表保持一致的坐标轴范围
1002+
1003+
**[max](~${componentType}.max) 的区别:**
1004+
- `max` 会固定坐标轴最大值,禁用自动刻度优化
1005+
- `dataMax` 只影响坐标轴范围,仍保持自动刻度优化
1006+
1007+
9501008
#${prefix} scale(boolean) = false
9511009

9521010
<ExampleUIControlBoolean />

zh/option/component/radar.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ const option = {
6565
none = true
6666
) }}
6767

68+
## clockwise(boolean) = false
69+
70+
{{ use: partial-version(version = "6.1.0") }}
71+
72+
<ExampleUIControlBoolean default="false" />
73+
74+
是否以顺时针排布指示器轴。
75+
6876
## startAngle(number) = 90
6977

7078
坐标系起始角度,也就是第一个指示器轴的角度。

zh/option/component/visual-map.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,55 @@ chart.setOption(option); // option设置回 ${componentMainType}
295295
可以是一个 id 或者一个 id 数组。
296296
默认取所有系列。
297297

298+
## seriesTargets(Array)
299+
300+
{{ use: partial-version(version = "6.1.0") }}
301+
302+
指定多个系列及其对应的维度映射关系。当配置了 `seriesTargets` 时,`seriesIndex``seriesId``dimension` 将被忽略。
303+
304+
这个选项允许单个 `visualMap` 组件同时控制多个系列的不同维度,特别适用于使用 dataset 的场景。
305+
306+
每个目标对象应包含以下属性:
307+
- `seriesIndex``seriesId`:指定系列(二者选其一)
308+
- `dimension`:指定该系列使用的数据维度
309+
310+
示例:
311+
```javascript
312+
option = {
313+
dataset: {
314+
source: [
315+
['product', 'sales', 'price', 'year'],
316+
['A', 100, 20, 2020],
317+
['B', 200, 30, 2021],
318+
['C', 150, 25, 2022]
319+
]
320+
},
321+
visualMap: {
322+
type: 'continuous',
323+
min: 0,
324+
max: 100,
325+
// 配置不同系列使用不同维度
326+
seriesTargets: [
327+
{
328+
seriesIndex: 0,
329+
dimension: 1 // 第一个系列使用 'sales' 维度
330+
},
331+
{
332+
seriesIndex: 1,
333+
dimension: 2 // 第二个系列使用 'price' 维度
334+
}
335+
],
336+
inRange: {
337+
color: ['#50a3ba', '#eac736', '#d94e5d']
338+
}
339+
},
340+
series: [
341+
{ type: 'bar' },
342+
{ type: 'line' }
343+
]
344+
};
345+
```
346+
298347
## hoverLink(boolean) = true
299348

300349
打开 `hoverLink` 功能时,鼠标悬浮到 `visualMap` 组件上时,鼠标位置对应的数值 在 图表中对应的图形元素,会高亮。

zh/option/series/pie.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ const option = {
547547

548548
+ 如果为 `true``'radial'`,则为径向排布。(`'radial'` 字面量从 `v5.2.0` 开始支持)
549549
+ 如果为 `'tangential'`,则为切向排布。(从 `v5.2.0` 开始支持)
550+
+ 如果为 `'tangential-noflip'`,则为切向排布,不反转。(从 `v6.1.0` 开始支持)
550551
+ 如果为 `number` ,旋转指定角度,从 -90 度到 90 度。正值是逆时针。
551552

552553

zh/tutorial/visual-map.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,45 @@ option = {
146146
};
147147
```
148148

149+
例三(使用 `seriesTargets` 映射不同系列的不同维度):
150+
```javascript
151+
option = {
152+
dataset: {
153+
source: [
154+
['product', 'sales', 'price', 'year'],
155+
['A', 100, 20, 2020],
156+
['B', 200, 30, 2021],
157+
['C', 150, 25, 2022]
158+
]
159+
},
160+
visualMap: [
161+
{
162+
type: 'continuous',
163+
min: 0,
164+
max: 100,
165+
// 使用 seriesTargets 可以为不同系列指定不同的映射维度
166+
// 当配置 seriesTargets 后,dimension、seriesIndex、seriesId 将被忽略
167+
seriesTargets: [
168+
{
169+
seriesIndex: 0,
170+
dimension: 1 // 第一个系列映射 'sales' 维度
171+
},
172+
{
173+
seriesIndex: 1,
174+
dimension: 2 // 第二个系列映射 'price' 维度
175+
}
176+
],
177+
inRange: {
178+
color: ['#50a3ba', '#eac736', '#d94e5d']
179+
}
180+
},
181+
...
182+
],
183+
series: [
184+
{ type: 'bar' },
185+
{ type: 'line' }
186+
]
187+
};
188+
```
189+
149190
更多详情,参见 [visualMap.inRange](option.html#visualMap.inRange)[visualMap.outOfRange](option.html#visualMap.outOfRange)

0 commit comments

Comments
 (0)