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
-[Multiple Types of Graphs](#multiple-types-of-graphs)
61
61
-[Aggregating data](#aggregating-data)
@@ -433,7 +433,7 @@ You can have as many y-axis as there are series defined in your configuration or
433
433
434
434
| Name | Type | Default | Since | Description |
435
435
| ---- | :--: | :-----: | :---: | ----------- |
436
-
| :white_check_mark: `id`| string | | v1.9.0 | The identification name of the yaxis used to map it to a serie. Needs to be unique. |
436
+
|`id` | string | | v1.9.0 | **Required** if you define multiple yaxis. The identification name of the yaxis used to map it to a serie. Needs to be unique. |
437
437
| `show` | boolean | `true` | v1.9.0 | Whether to show or not the axis on the chart |
438
438
| `opposite` | boolean | `false` | v1.9.0 | If `true`, the axis will be shown on the right side of the chart |
439
439
| `min` | `auto`, number or string | `auto` | v1.9.0 | If undefined or `auto`, the `min` of the yaxis will be automatically calculated based on the min value of all the series associated to this axis. See [below](#minmax-format) for other formats. |
@@ -452,41 +452,60 @@ You can have as many y-axis as there are series defined in your configuration or
452
452
* `min: '|-20|'`: The min of the data in the series is `32`, the y-axis min will be `12` (= `32 - 20`)
453
453
* `max: '|+10|'`: The max of the data in the series is `32`, the y-axis max will be `42` (= `32 + 10`)
454
454
455
-
#### Example
455
+
#### Examples
456
456
457
-
In this example, we have 2 sensors:
458
-
* `sensor.random0_100`: goes from `0` to `100`
459
-
* `sensor.random_0_1000`: goes from `0` to `1000`
457
+
* Simple example with one y-axis:
460
458
461
-
The `min` and `max` of both y-axis are auto calculated based on the spread of the data associated with each axis.
459
+
```yaml
460
+
type: custom:apexcharts-card
461
+
header:
462
+
show: true
463
+
title: Max Soft Bounds + Min Fixed Bound
464
+
graph_span: 20min
465
+
series:
466
+
- entity: sensor.random0_100
467
+
yaxis: # only 1 yaxis, no need for id or yaxis_id
468
+
- min: 0
469
+
# if the sensor doesn't go above 50, the max of the axis will be 50
470
+
# else the max will be the maximum value of the sensor
471
+
max: ~50
472
+
apex_config:
473
+
tickAmount: 4
474
+
```
462
475
463
-

476
+
* In this example, we have 2 sensors:
477
+
* `sensor.random0_100`: goes from `0` to `100`
478
+
* `sensor.random_0_1000`: goes from `0` to `1000`
464
479
465
-
```yaml
466
-
type: custom:apexcharts-card
467
-
graph_span: 20min
468
-
yaxis:
469
-
- id: first # identification name of the first y-axis
470
-
apex_config:
471
-
tickAmount: 4
472
-
- id: second # identification name of the second y-axis
473
-
opposite: true # make it show on the right side
474
-
apex_config:
475
-
tickAmount: 4
476
-
all_series_config:
477
-
stroke_width: 2
478
-
series:
479
-
- entity: sensor.random0_100
480
-
yaxis_id: first # this serie will be associated to the 'id: first' axis.
481
-
- entity: sensor.random_0_1000
482
-
yaxis_id: second # this serie will be associated to the 'id: second' axis.
483
-
- entity: sensor.random0_100
484
-
yaxis_id: first # this serie will be associated to the 'id: first' axis.
485
-
transform: 'return Number(x) + 30;' # We make it go fom 30 to 130
486
-
- entity: sensor.random0_100
487
-
yaxis_id: first # this serie will be associated to the 'id: first' axis.
488
-
transform: 'return Number(x) - 30;' # We make it go from -30 to 70
489
-
```
480
+
The `min` and `max` of both y-axis are auto calculated based on the spread of the data associated with each axis.
481
+
482
+

483
+
484
+
```yaml
485
+
type: custom:apexcharts-card
486
+
graph_span: 20min
487
+
yaxis:
488
+
- id: first # identification name of the first y-axis
489
+
apex_config:
490
+
tickAmount: 4
491
+
- id: second # identification name of the second y-axis
492
+
opposite: true # make it show on the right side
493
+
apex_config:
494
+
tickAmount: 4
495
+
all_series_config:
496
+
stroke_width: 2
497
+
series:
498
+
- entity: sensor.random0_100
499
+
yaxis_id: first # this serie will be associated to the 'id: first' axis.
500
+
- entity: sensor.random_0_1000
501
+
yaxis_id: second # this serie will be associated to the 'id: second' axis.
502
+
- entity: sensor.random0_100
503
+
yaxis_id: first # this serie will be associated to the 'id: first' axis.
504
+
transform: 'return Number(x) + 30;' # We make it go fom 30 to 130
505
+
- entity: sensor.random0_100
506
+
yaxis_id: first # this serie will be associated to the 'id: first' axis.
507
+
transform: 'return Number(x) - 30;' # We make it go from -30 to 70
0 commit comments