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

Simplify how data is passed to Long term graph #2374

Merged
merged 2 commits into from
Sep 27, 2022
Merged

Conversation

rdwebdesign
Copy link
Member

What does this PR aim to accomplish?

  • Simplify how data is passed to Long term graph

How does this PR accomplish the above?

  • Remove unnecessary step used to fill all empty time-slots with zeros.
  • Set the min and max for the x-axis on javascript code and let chartsj handle the empty slots.

What documentation changes (if any) are needed to support this PR?

none


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

@PromoFaux
Copy link
Member

Discussion here: #2372

@rdwebdesign rdwebdesign requested a review from a team September 24, 2022 17:41
@yubiuser yubiuser linked an issue Sep 25, 2022 that may be closed by this pull request
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
@rdwebdesign rdwebdesign requested review from a team and removed request for a team September 26, 2022 17:41
@rdwebdesign
Copy link
Member Author

Note:
I rebased the branch.

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

Works with my fake data.

scripts/pi-hole/js/db_graph.js Show resolved Hide resolved
@yubiuser
Copy link
Member

Confirmed working in #2372

@rdwebdesign rdwebdesign merged commit 17487b3 into devel Sep 27, 2022
@rdwebdesign rdwebdesign deleted the fix/db_graph branch September 27, 2022 18:19
@yubiuser
Copy link
Member

We might need to revise

Remove unnecessary step used to fill all empty time-slots with zeros.

as spanGaps: false isn't going to work anymore.

Screenshot at 2022-09-29 09-14-08

Instead of adding 0 we could add NaN and get a real break like here: https://jsfiddle.net/srq8hzw2/

@yubiuser
Copy link
Member

yubiuser commented Sep 29, 2022

Setting it to NaN

Screenshot at 2022-09-29 09-25-42

@yubiuser
Copy link
Member

The code will need adjustment - it now prints nothing if not both datasets (blocked, permitted) contain data. If only one contains data, the other isn't shown for that interval.

@rdwebdesign
Copy link
Member Author

I think I fixed.

Please, test the new branch.
If it works, I'll open a PR.

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

Successfully merging this pull request may close these issues.

Long-Term Data -> Graphics are fading in an disappear
3 participants