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

🐛 [Bug] - Profit and Loss Graph breaking on dashboard #820

Closed
njmulsqb opened this issue Jan 23, 2024 · 2 comments
Closed

🐛 [Bug] - Profit and Loss Graph breaking on dashboard #820

njmulsqb opened this issue Jan 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@njmulsqb
Copy link

Expected Behavior

It should stay within the axis like for filter "this year"
image

Current Behavior

P&L graph is going out of axis in dashboard when "Year to Date" is selected
image

Steps to Reproduce

No response

FrappeBooks Version

0.20.1

Path or Feature name

Dashboard

Country

Pk

Language

EN

OS

Macos (Apple Silicon)

Additional OS Info

No response

@njmulsqb njmulsqb added the bug Something isn't working label Jan 23, 2024
@njmulsqb
Copy link
Author

image
Errors errors all the way. Miscalculated values and broken graphs, frappe seems to be in trouble recently

@Isaac-GC
Copy link
Collaborator

Unfortunately, in this case, it looks like this issue has been around for a while and has been hiding. It was fixed in #821 and in the latest version of Frappe Books

What happened is that the backend logic tries to figure out how to arrange and count the items needed for the graphs. In doing so, it subtracts 1 from a count and then divides by that subsequent value. As "Year to Date" starts with January, there will only be one item collected, and when 1 is subtracted from the items collected, there is 0 items/results remaining. That value (0) will be used in the denominator to try and divide by 0... which resulted in those (excessive) errors

Note: The line graph may look empty in the latest update, but the values are there and as soon as we hit February 1st (next Thursday), the line graph will show up as expected. The reason they don't show up now is that there is only one set of values for each of the profit and loss points, and when February hits, you'll have two sets of values each which will show up as expected.
This has been part of the design since the feature had been added. IMO, it should be updated so if there is only set of values, you can at least see them on the graph. --> this will likely be in a future feature update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants