betrter y-axis labels

This commit is contained in:
2026-08-22 12:08:46 +02:00
parent 0fa77c72d6
commit 3b5be804e2
3 changed files with 14 additions and 3 deletions
+5 -2
View File
@@ -404,8 +404,11 @@ samples existed before the RRD was created.
Temperature uses the left axis with a default range of 030°C. Humidity and Temperature uses the left axis with a default range of 030°C. Humidity and
battery use the right axis with a default range of 0100%. These ranges and battery use the right axis with a default range of 0100%. These ranges and
labels can be changed in `config.yaml` under `graph.axes`. Light-grey reference labels can be changed in `config.yaml` under `graph.axes`. Temperature grid
lines are drawn at 15, 20, and 25°C by default and can be changed under labels default to five-degree intervals, and both axes display integers. Since
RRDtool ties the right axis to the left, the corresponding percentage labels
are rounded to integers. Light-grey reference lines are drawn at 15, 20, and
25°C by default and can be changed under
`graph.axes.temperature.reference_lines`. `graph.axes.temperature.reference_lines`.
The collector also generates `/var/www/html/sensors/index.html`. It displays The collector also generates `/var/www/html/sensors/index.html`. It displays
+5 -1
View File
@@ -78,6 +78,9 @@ graph:
minimum: 0 minimum: 0
maximum: 30 maximum: 30
label: degrees C label: degrees C
grid_interval: 5
label_every_grid_lines: 1
number_format: "%.0lf"
reference_lines: reference_lines:
- value: 15 - value: 15
color: D3D3D3 color: D3D3D3
@@ -86,9 +89,10 @@ graph:
- value: 25 - value: 25
color: D3D3D3 color: D3D3D3
percentage: percentage:
minimum: 0 minimum: 10
maximum: 100 maximum: 100
label: percent label: percent
number_format: "%.0lf"
periods: periods:
day: day:
start: end-1d start: end-1d
+4
View File
@@ -226,8 +226,12 @@ def render_graphs(sensor: Sensor, rrd_path: Path, config: Config) -> None:
"--end", str(graph["end"]), "--end", str(graph["end"]),
"--title", f"{sensor.name} - {period['label']}", "--title", f"{sensor.name} - {period['label']}",
"--vertical-label", str(temperature_axis["label"]), "--vertical-label", str(temperature_axis["label"]),
"--y-grid",
f"{temperature_axis['grid_interval']}:{temperature_axis['label_every_grid_lines']}",
"--left-axis-format", str(temperature_axis["number_format"]),
"--right-axis", f"{right_axis_scale}:{right_axis_shift}", "--right-axis", f"{right_axis_scale}:{right_axis_shift}",
"--right-axis-label", str(percentage_axis["label"]), "--right-axis-label", str(percentage_axis["label"]),
"--right-axis-format", str(percentage_axis["number_format"]),
"--lower-limit", str(temperature_minimum), "--lower-limit", str(temperature_minimum),
"--upper-limit", str(temperature_maximum), "--upper-limit", str(temperature_maximum),
"--rigid", "--rigid",