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:
jonfawcett
2020-01-18 03:36:31 -08:00
committed by Sulka Haro
parent d095482c2c
commit 3386ac685c
+20
View File
@@ -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')