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

Graph: Place the Y grid dynamically if there is no scale #14407

Merged
merged 1 commit into from Sep 30, 2022

Conversation

mpikzink
Copy link
Contributor

Place the Y grid dynamically based on the graph's Y range. The algorithm ensures that you always have a grid, that there are enough but not too many grid lines, and that the grid is metric. That is the grid lines are placed every 1, 2, 5 or 10 units. This parameter will also ensure that you get enough decimals displayed even if your graph goes from 69.998 to 70.001.

Plot

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

Place the Y grid dynamically based on the graph's Y range. The algorithm ensures that you always have a grid, that there are enough but not too many grid lines, and that the grid is metric. That is the grid lines are placed every 1, 2, 5 or 10 units. This parameter will also ensure that you get enough decimals displayed even if your graph goes from 69.998 to 70.001. (contributed by Sasha Mikheev).
@mpikzink mpikzink changed the title Update common.inc.php Plot Place the Y grid dynamically if there is no scale Sep 29, 2022
@mpikzink mpikzink changed the title Plot Place the Y grid dynamically if there is no scale Plot: Place the Y grid dynamically if there is no scale Sep 29, 2022
@mpikzink mpikzink changed the title Plot: Place the Y grid dynamically if there is no scale Graph: Place the Y grid dynamically if there is no scale Sep 29, 2022
Copy link
Contributor

@PipoCanaja PipoCanaja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PipoCanaja
Copy link
Contributor

Thx @mpikzink !

@PipoCanaja PipoCanaja merged commit 698275d into librenms:master Sep 30, 2022
@fcqpl
Copy link
Contributor

fcqpl commented Oct 1, 2022

Hi @mpikzink,
Your commit broke Y grid on our LibreNMS instance.
Before:
chrome_cmSdxc458E
After:
chrome_wEXBDrDaLp

Could you please check this?

@PipoCanaja
Copy link
Contributor

Hi @mpikzink, Your commit broke Y grid on our LibreNMS instance. Before: chrome_cmSdxc458E After: chrome_wEXBDrDaLp

Could you please check this?

Hi @fcqpl
Please let us know exactly which page you have this display ?

@fcqpl
Copy link
Contributor

fcqpl commented Oct 1, 2022

Hi @PipoCanaja,
This is from dashboard graph "Manual ports", which is linked to /graphs/id=6562585,6562588,6562603,6562606/type=multiport_bits_separate
Same with "Overall Traffic", "Memory" in Device overview.

@mpikzink
Copy link
Contributor Author

mpikzink commented Oct 2, 2022

Thanks for your hint, I can also reproduce it. In some cases, the rrdtool option seems to have other grid label ratio, which is not configurable. I try to look in the sources of rrdtool. Perhaps I find a better solution which solve both issues. I haven't found some in the manuals, yet.

murrant added a commit that referenced this pull request Oct 3, 2022
@murrant murrant added Graphs Ignore changelog 🔇 If selected, will not be included in changelog labels Oct 3, 2022
murrant added a commit that referenced this pull request Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graphs Ignore changelog 🔇 If selected, will not be included in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants