Skip to content

TIR band fixes - #57

Merged
kristinkand merged 1 commit into
kristinkand:feature/tir-bandfrom
bjorkert:tir-band-fixes
Oct 10, 2026
Merged

kristinkand merged 1 commit into
kristinkand:feature/tir-bandfrom
bjorkert:tir-band-fixes

Conversation

@bjorkert

Copy link
Copy Markdown

These are fixes for the TIR band PR. The band now uses TIRCalculator, the same code as the TIR chart in Stats, so each reading is counted once. Before, a custom low limit below 54 could count a reading as both very low and in range. It now has a very high segment above 250 and uses the LoopFollow colors from the Stats TIR chart. Small segments always get a minimum width, so a single very low reading is visible even late in the day. The bar now fills the full width of the band. The Stats Style setting is only in General and has been removed from Units and Metrics.

The band now uses TIRCalculator, so each reading is counted once with
the same 54 and 250 mg/dL cutoffs as the TIR chart in Stats. It also
has a very high segment and uses the same colors as that chart. Every
non-empty segment gets a minimum width so a single low reading stays
visible, and the bar fills the full width of the band. The Stats Style
setting is only in General.
@kristinkand
kristinkand merged commit 6b7b01d into kristinkand:feature/tir-band Oct 10, 2026
@bjorkert
bjorkert deleted the tir-band-fixes branch October 10, 2026 14:34
kristinkand added a commit that referenced this pull request Oct 10, 2026
TIR band: custom range bounds, threshold refresh, shared title

Great catch!
#57 fixed the double counting: since then, every reading lands in exactly one segment.
#58 fixes which segment it lands in. With a custom low limit below 3.0 mmol/L, a reading between that limit and 3.0 is in your range, so it shouldn’t count as “very low”. Before #58, the band and the statistics box could therefore show different in-range percentages for such custom ranges. Now they match.

This only matters with a custom range that reaches below 3.0 or above 13.9 mmol/L. With TIR, TITR or TING nothing changes, because those ranges never go past those limits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants