You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/option/component/axis-common.md
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -949,6 +949,66 @@ max: function (value) {
949
949
950
950
`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`).
951
951
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
Copy file name to clipboardExpand all lines: en/option/component/visual-map.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -325,6 +325,55 @@ Specify visual mapping should be performed on which series, from which
325
325
Can be a id or a list of ids.
326
326
All series are used by default.
327
327
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
+
328
377
## hoverLink(boolean) = true
329
378
330
379
`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.
0 commit comments