Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: calculate yAxisTicks based on given values #1142

Merged
merged 3 commits into from
Jan 19, 2024
Merged

feat: calculate yAxisTicks based on given values #1142

merged 3 commits into from
Jan 19, 2024

Conversation

theknut
Copy link
Contributor

@theknut theknut commented Jan 18, 2024

IMHO the yAxisTicks parameter for chartPage is a little bit hard to understand, given the required formatting. Besides that, in the example the yAxisTicks for the office temperature are from -25° to +25° C which makes no sense, at least for me.
But there is really no need to provide them at all because we can caluclate the yAxisTicks based on the provided values. In this pull request there is an added algorithm which calculates the ticks if no yAxisTicks was provided for the page. This makes configuring the chartPage a little bit easier and more responsive.

Example debug logging:

Calculated yAxisTicks for 0_userdata.0....Temperature (Min: 186, Max: 214, Tick: 10): 176,186,196,206,216
Calculated yAxisTicks for 0_userdata.0....Humidity (Min: 650, Max: 729, Tick: 16): 634,650,666,682,698,714,730
Calculated yAxisTicks for 0_userdata.0....Speedtest.Download (Min: 137, Max: 581, Tick: 89): 48,137,226,315,404,493,582

Notice how the amount of calculated ticks changes with the given range of values to display.

image

If no yAxisTicks are provided for the signal, try to calculate it based on the given values.
@theknut
Copy link
Contributor Author

theknut commented Jan 18, 2024

Additionally the documentation needs to be updated accordingly. I have an updated script for writing the signal values using InfluxDB. I can update the documentation with the same PR, if you like.

@Armilar Armilar self-assigned this Jan 19, 2024
@Armilar Armilar added the ioBroker releated to ioBroker Script label Jan 19, 2024
@Armilar
Copy link
Collaborator

Armilar commented Jan 19, 2024

Works very well. For the documentation in the Wiki, all that needs to be noted is that the yAxisTicks parameter is not required in the PageItem and is calculated automatically in this case.

image

@Armilar Armilar merged commit 74a329c into joBr99:main Jan 19, 2024
9 checks passed
@theknut
Copy link
Contributor Author

theknut commented Jan 19, 2024

I'll do that together with the next upcomming PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ioBroker releated to ioBroker Script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants