-
Notifications
You must be signed in to change notification settings - Fork 1
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
[14.0][BCP] project_forecast_line_bokeh_chart #7
Conversation
script, div = components(grid, wrap_script=False) | ||
self.bokeh_chart = json.dumps({"div": div, "script": script}) | ||
script, div = components(grid) | ||
self.bokeh_chart = "%s%s" % (div, script) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've forwarded ported the new bokeh, so it would also be an option to depend on that PR instead of doing this.
field_name = df.split(":")[0] | ||
if group.get(df): | ||
range_from, range_to = group[df][0].split("/") | ||
group["__range"][field_name] = {"from": range_from, "to": range_to} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I've looked into why the graph is showing empty, and how it looks like to me is:
- Here, you're filling
from
andto
- Here, you're using it to retrieve
date
, which is then used as a dictionary key. These dictionary keys show in a formatW26 2023
for week;26 Jun 2023
for day, orJun 2023
for month. - Here however, you're retrieving the list of dates to iterate over, which you're then using to get from the dictionary. These dates are in format
2023-06-26
.
Thus, the get
does not use the right key and always retrieves 0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if, instead if from
, you would use the date:self.granularity
key? You'd get results like:
{'__count': 524,
'__domain': ['&', ('date', '>=', '2023-06-01'), ('date', '<', '2023-07-01')],
'amount': 51335.3,
'date:month': 'juni 2023'}]
and then store them in the dict under key juni 2023
, such as now.
Now, you'll change this dict into an OrderedDict, so that it remembers the order in which keys are added.
Finally, here you won't be picking the data by accessing each date key in turn, but you'll instead just loop all of the keys in the dict, in the correct order.
Enhance the display in the bokeh chart to better display negative consolidated capacity. Without the fix, the stacked vbar would display the negative capacity bar starting from the top of the stack and going down, superposed on positive capacity bars, which was confusing. This fix gathers overload capacity (negative consolidated capacities) and plots them in a separacte vbar with only negative values, which produces an easier to understand chart. See bokeh/bokeh#9011 for a discussion of this stacked bar chart behavior in bokeh.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: project-15.0/project-15.0-project_forecast_line_bokeh_chart Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_forecast_line_bokeh_chart/
c38c785
to
cbe5cff
Compare
27770f7
to
5be7294
Compare
No description provided.