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

Update DayToDay report for Loop Overrides #5452

Merged
merged 1 commit into from
Jan 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/report_plugins/daytoday.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,26 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio
.attr('y', yScale2(client.utils.scaleMgdl(306)) + padding.top)
.attr('x', xScale2(treatment.mills + times.mins(treatment.duration).msecs / 2) + padding.left)
.text(treatment.notes);
} else if (treatment.eventType === 'Temporary Override' && treatment.duration ) {
// Loop Overrides with duration
context.append('rect')
.attr('x', xScale2(treatment.mills) + padding.left)
.attr('y', yScale2(client.utils.scaleMgdl(432)) + padding.top)
.attr('width', xScale2(treatment.mills + times.mins(treatment.duration).msecs) - xScale2(treatment.mills))
.attr('height', yScale2(client.utils.scaleMgdl(396)) - yScale2(client.utils.scaleMgdl(432)))
.attr('stroke-width', 1)
.attr('opacity', .2)
.attr('stroke', 'white')
.attr('fill', 'black');
context.append('text')
.style('font-size', '12px')
.style('font-weight', 'bold')
.attr('fill', 'black')
.attr('text-anchor', 'middle')
.attr('dy', '.35em')
.attr('y', yScale2(client.utils.scaleMgdl(414)) + padding.top)
.attr('x', xScale2(treatment.mills + times.mins(treatment.duration).msecs / 2) + padding.left)
.text(treatment.reason);
} else if (!treatment.duration) {
// other treatments without duration
context.append('circle')
Expand Down