mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Update DayToDay report for Loop Overrides (#5452)
Add Loop override name/reason as text to the grey bar at the top of the graph.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user